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

Chris Moore
2010-10-18T18:00:27Z

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