> explicit sensor_device_attr array initializations > a. declare arrays, initialize them with repeated __SENSOR_DEVICE_ATTR's > b. loop over calls to device_create_file() > > b could be done separately, but it seems silly - > all the calls need to be touched for (a) anyway, might as well do > so just once. > and its not like you'd declare an array wo planning to use it. > > This patch is motivated/justified by comments from GregKH, in msg 11 of: > > http://groups-beta.google.com/group/linux.kernel/browse_frm/thread/fa10a47a3c843d08/2a1465afa2f83afe?q=dynamic+sysfs+callbacks&rnum=10&hl=en#2a1465afa2f83afe > > > > > No, I hate HEAD and TAIL macros. This really isn't buying you much > > > code savings, you could do it yourself with the __ATTR() macro > > > yourself with the same ammount of code I bet... > > Hm, which makes me want to go look at trying to convert those attributes > to an array right now... > $ diffstat 06-pc87360-array-init-loop.patch pc87360.c | 349 ++++++++++++++++++++++++++++---------------------------------- 1 files changed, 162 insertions(+), 187 deletions(-) Signed-off-by: Jim Cromie <jcromie at divsol.com> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 06-pc87360-array-init-loop.patch Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050803/58c383a5/attachment.pl