[lm-sensors] [ patch ] de-macro-fy w83627hf.c
Jim Cromie
jim.cromie at gmail.com
Tue Jul 10 21:52:37 CEST 2007
Thank you Krzysztof for your review.
This 2nd rev does:
- rebases on Marks GIT tree (thought I had, sorry)
- fixes all 80-column probs in last, plus a few others
- adopts new fashion int nr = to_sensor_dev_attr(devattr)->index;
- folds many one-caller functions into the caller
- converts remaining fn-generating macros to plain old functions
WRT types and conversions in the *_FROM/TO_REG macros,
thanks for the detailed review, tracing thru the conversions is time
consuming, and feels error prone..
- I dropped the (long) casts in some cases,
- and pushed them down into the macros in others
- Im disappointed that sparse/C=1 didnt identify these things
Im reluctant to do more here (Do No Harm, leave well enough alone).
It seems that a full review, and conversion to static inline functions
is warranted, and probably should be done separately.
<update>
Ive now seen Jean's comments, and have manually (I hope fully) backed
out the three 'types and conversions' fixes above, reverting to
original form. I have a set of interim diffs, so I *could* go back
and reconstruct things, but I would *really* like to avoid doing so;
its tedious and error prone.
FWIW - the patch results in a smaller object.
14627 2464 36 17127 42e7
lx-git-hwmon/drivers/hwmon/w83627hf.ko
12895 2676 36 15607 3cf7
lx-git-hwmon-demacro/drivers/hwmon/w83627hf.ko
---
Convert hwmon/w83627hf to use dynamic sysfs callbacks, replacing the
function-generating macros.
Signed-off-by: Jim Cromie <jim.cromie at gmail.com
[jimc at groucho lx]$ diffstat diff.hwmon-w83627hf-demacro-sysfs-callbacks
w83627hf.c | 887
++++++++++++++++++++++++++++++-------------------------------
1 file changed, 449 insertions(+), 438 deletions(-)
PS: attached file contains this same intro, hth.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff.hwmon-w83627hf-demacro-sysfs-callbacks
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20070710/e84ae5e2/attachment-0001.pl
More information about the lm-sensors
mailing list