lkml.org 
[lkml]   [2009]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch] acerhdf: Return temperature in milidegree
Hi,

On Mon, Oct 19, 2009 at 10:21:16AM +0200, Peter Feuerer wrote:
>
> Hi Boris,
>
> what do you think about this patch?

Personally I'm hurting a bit due to the open-coded "* 1000" transition
in all places.

I'd add a helper macro
#define TEMP_DEGREE_TO_SYS(x) ((x) * 1000)
and use that in all places where it matters.

Advantage:
- either no mistyping (10000 instead of 1000) _or_ bug occurring in _all_
places where this macro is used
- easily grepped-for
- easily changed once the system granularity gets updated

Andreas Mohr


\
 
 \ /
  Last update: 2009-10-19 11:19    [W:0.120 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site