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

Guenter Roeck
2010-10-18T18:35:30Z

On Mon, Oct 18, 2010 at 02:00:27PM -0400, Chris Moore wrote:
>
> 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;
>
yes...

thanks for the correction.

Guenter