[RFC PATCH 6/6] hwmon: OMAP4: On die temperature sensor driver
Guenter Roeck
guenter.roeck at ericsson.com
Thu Aug 11 12:38:22 EDT 2011
On Thu, 2011-08-11 at 09:00 -0400, J, KEERTHY wrote:
> On Thu, Aug 11, 2011 at 4:06 PM, Felipe Balbi <balbi at ti.com> wrote:
[ ... ]
> >> >> + temp = omap_temp_sensor_readl(temp_sensor,
> >> >> + temp_sensor->registers->bgap_counter);
> >> >> + temp = (temp & temp_sensor->registers->counter_mask) >>
> >> >> + __ffs(temp_sensor->registers->counter_mask);
> >> >
> >> > temp &= ??
> >> >
> >> >> + temp = temp * 1000 / (temp_sensor->clk_rate);
> >> >
> >> > temp *= ??
> >>
> >> Need to multiply the temp with 1000 before dividing.
> >> temp *= evaluates the RHS first and then multiplies LHS.
> >
> > temp *= 1000;
> > temp /= clk_rate;
> >
>
> Different coding style. I preferred to do it in a single line.
>
Me too.
Guenter
More information about the linux-arm-kernel
mailing list