[patch 1/1] w83627hf hoist nr-1 offset out of show-store-temp-X

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

The array conversion changes temp[1] from u8 to u16, but this was
happening implicitly via the helper functions anyway.

Signed-off-by:  Jim Cromie <jim.cromie at gmail.com>
---
$ diffstat diff.hwmon-w83627hf-hoist-temp-offsets
 drivers/hwmon/w83627hf.c |  120 +++++++++++++++++------------------------------
 1 files changed, 44 insertions(+), 76 deletions(-)


> size shrinks too:
>   12982    2652      36   15670    3d36 hwmon-demacro/drivers/hwmon/w83627hf.ko
>   12850    2652      36   15538    3cb2 hwmon-hf-2/drivers/hwmon/w83627hf.ko
>
> and the u8->u16 doesnt seem to cost anything in the data section. (padding?)
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.hwmon-w83627hf-hoist-temp-offsets
Type: application/octet-stream
Size: 7133 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20071012/51ecb0fe/attachment.obj 


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux