[lm-sensors] [patch 1/1] w83627hf hoist nr-1 offset out of show-store-temp-X
Jim Cromie
jim.cromie at gmail.com
Mon Oct 15 01:10:52 CEST 2007
Jean Delvare wrote:
> Hi Jim,
>
> On Fri, 12 Oct 2007 17:56:41 -0600, Jim Cromie wrote:
>
>> this patch replaces last, fixing (long) cast placement,
>> and one previously missed (nr>=2) -> (nr)
>>
>> This hoists nr-1 offset out of (show|store)_temp_*(.*) callbacks, and into
>> SENSOR_DEVICE_ATTRs for sysfs tempN_X files. It also combines
>> temp[1] and temp_add[2] (array) fields in w83627hf_data into 3 elem arrays,
>> which simplifies special-case handling of nr, allowing simplification
>> of callback bodies and rerolling a flattened loop in
>> w83627hf_update_device(struct device *dev).
>>
>
> Very nice cleanup, thanks.
>
>
thank you.
respun per your feedback.
>
> Could be made const. Please also name these w83627hf_reg_* instead of
> w83781d_reg_*. Ultimately we want to remove all references to w83781d
> from this driver.
>
>
Done. I included W83627HF_REG_TEMP2,3_CONFIG since theyre
so close (lexically and semantically) that it'd more confusing to leave
them.
would you take a sed -e s/W83781D/W83627HF/
or a sed -e s/W83781D_REG/W83627HF_REG/ patch ?
or is it more selective than that ?
that said, the current names are a hint about chip & driver
heritage and commonality.
>
>> + tmp = (nr) ? LM75_TEMP_TO_REG(val)
>> + : TEMP_TO_REG(val);
>>
>
> This instruction could be moved outside of the lock-holding section.
>
>
OK - I turned these into decl+init statement,
and took out a little whitespace.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff.hwmon-w83627hf-hoist-temp-offsets
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20071014/461c6cd6/attachment.pl
More information about the lm-sensors
mailing list