1) Fix formatting to comply with linux kernal standard.
2) Remove unused includes.
Changed roundoff correction frequency.
Move several static variables to a global structure which is
allocated only if the module runs.