Re: [PATCH] thermal: Fix KELVIN_TO_CELSIUS macro

2014-04-02 Thread Zhang Rui
On Sun, 2014-03-23 at 22:30 -0700, Guenter Roeck wrote: > On 03/23/2014 09:25 PM, Joe Perches wrote: > > On Sun, 2014-03-23 at 21:14 -0700, Guenter Roeck wrote: > >> It is always a good idea to use paranthesis around macro parameters > >> to avoid undesired side effects. > >> > >> In this specific

Re: [PATCH] thermal: Fix KELVIN_TO_CELSIUS macro

2014-04-02 Thread Zhang Rui
On Sun, 2014-03-23 at 22:30 -0700, Guenter Roeck wrote: On 03/23/2014 09:25 PM, Joe Perches wrote: On Sun, 2014-03-23 at 21:14 -0700, Guenter Roeck wrote: It is always a good idea to use paranthesis around macro parameters to avoid undesired side effects. In this specific case,

Re: [PATCH] thermal: Fix KELVIN_TO_CELSIUS macro

2014-03-23 Thread Guenter Roeck
On 03/23/2014 09:25 PM, Joe Perches wrote: On Sun, 2014-03-23 at 21:14 -0700, Guenter Roeck wrote: It is always a good idea to use paranthesis around macro parameters to avoid undesired side effects. In this specific case, KELVIN_TO_CELSIUS() is used in drivers/platform/x86/asus-wmi.c with

Re: [PATCH] thermal: Fix KELVIN_TO_CELSIUS macro

2014-03-23 Thread Joe Perches
On Sun, 2014-03-23 at 21:14 -0700, Guenter Roeck wrote: > It is always a good idea to use paranthesis around macro parameters > to avoid undesired side effects. > > In this specific case, KELVIN_TO_CELSIUS() is used in > drivers/platform/x86/asus-wmi.c with parameter "value & 0x", > which due

[PATCH] thermal: Fix KELVIN_TO_CELSIUS macro

2014-03-23 Thread Guenter Roeck
It is always a good idea to use paranthesis around macro parameters to avoid undesired side effects. In this specific case, KELVIN_TO_CELSIUS() is used in drivers/platform/x86/asus-wmi.c with parameter "value & 0x", which due to operator evaluation order causes more or less random results.

[PATCH] thermal: Fix KELVIN_TO_CELSIUS macro

2014-03-23 Thread Guenter Roeck
It is always a good idea to use paranthesis around macro parameters to avoid undesired side effects. In this specific case, KELVIN_TO_CELSIUS() is used in drivers/platform/x86/asus-wmi.c with parameter value 0x, which due to operator evaluation order causes more or less random results.

Re: [PATCH] thermal: Fix KELVIN_TO_CELSIUS macro

2014-03-23 Thread Joe Perches
On Sun, 2014-03-23 at 21:14 -0700, Guenter Roeck wrote: It is always a good idea to use paranthesis around macro parameters to avoid undesired side effects. In this specific case, KELVIN_TO_CELSIUS() is used in drivers/platform/x86/asus-wmi.c with parameter value 0x, which due to

Re: [PATCH] thermal: Fix KELVIN_TO_CELSIUS macro

2014-03-23 Thread Guenter Roeck
On 03/23/2014 09:25 PM, Joe Perches wrote: On Sun, 2014-03-23 at 21:14 -0700, Guenter Roeck wrote: It is always a good idea to use paranthesis around macro parameters to avoid undesired side effects. In this specific case, KELVIN_TO_CELSIUS() is used in drivers/platform/x86/asus-wmi.c with