[PATCH 1/2] hwmon: add generic GPIO fan driver

Chris Moore moore at free.fr
Mon Oct 18 14:00:27 EDT 2010


  Hi,

Le 18/10/2010 18:08, Guenter Roeck a écrit :
> On Sun, Oct 17, 2010 at 11:50:11AM -0400, Simon Guinot wrote:
>
>> +static void __set_fan_ctrl(struct gpio_fan_data *fan_data, int ctrl_val)
>> +{
>> +       int i;
>> +
>> +       for (i = 0; i<  fan_data->num_ctrl; i++) {
>> +               int value = !!(ctrl_val&  (1<<  i));
>> +
> 	value = (ctrl_val&  (1>>  i));
>      would be much simpler and easier to understand.

IMHO you mean:

	value = (ctrl_val>>  i)&  1;


Cheers,
Chris



More information about the linux-arm-kernel mailing list