[PATCH 1/2] hwmon: add generic GPIO fan driver
Guenter Roeck
guenter.roeck at ericsson.com
Mon Oct 18 14:35:30 EDT 2010
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
More information about the linux-arm-kernel
mailing list