From mboxrd@z Thu Jan 1 00:00:00 1970 From: jim.cromie@gmail.com (Jim Cromie) Date: Fri, 01 Sep 2006 19:17:26 +0000 Subject: [lm-sensors] TODO: "dynamic" sysfs callbacks (plus 2D Message-Id: <44F88746.6090801@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lm-sensors@vger.kernel.org Jean Delvare wrote: > Hi Jim, > > >> once again with the email-harvesting / communication/coordination. >> >> >> >> BTW, do you have any plan to convert the asb100 driver to use the >> "dynamic" sysfs callbacks? This would kill some more macros, and shrink >> the driver size even more. >> >> >> Heres a shorter, more accurate list, it finds the macro-repeated functions. They're the biggest opportunity for code-shrink; N->1 for function bodies. [jimc at harpo hwmon-stuff]$ grep -n 'static ssize_t' w83-1/drivers/hwmon/*.c |grep '##' | cut -d: -f1 | sort -u w83-1/drivers/hwmon/adm1021.c w83-1/drivers/hwmon/adm1025.c w83-1/drivers/hwmon/adm1031.c w83-1/drivers/hwmon/asb100.c w83-1/drivers/hwmon/ds1621.c w83-1/drivers/hwmon/fscher.c w83-1/drivers/hwmon/fscpos.c w83-1/drivers/hwmon/gl518sm.c w83-1/drivers/hwmon/gl520sm.c w83-1/drivers/hwmon/lm75.c w83-1/drivers/hwmon/lm77.c w83-1/drivers/hwmon/lm78.c w83-1/drivers/hwmon/lm80.c w83-1/drivers/hwmon/lm85.c w83-1/drivers/hwmon/lm87.c w83-1/drivers/hwmon/lm92.c w83-1/drivers/hwmon/max1619.c w83-1/drivers/hwmon/sis5595.c w83-1/drivers/hwmon/smsc47b397.c w83-1/drivers/hwmon/smsc47m1.c w83-1/drivers/hwmon/via686a.c w83-1/drivers/hwmon/w83627ehf.c w83-1/drivers/hwmon/w83627hf.c w83-1/drivers/hwmon/w83781d.c w83-1/drivers/hwmon/w83791d.c w83-1/drivers/hwmon/w83792d.c >> drivers/hwmon/adm1026.c - patch on hold, needs tester. >> > > I had to discard it from my stack, it no more applies after Mark M. > Hoffman's patch fixing unchecked return values. > > Ack. > I do not consider the dynamic sysfs callbacks conversion as "must be > done". Of course drivers are nicer and smaller when done, but this is a > significant work, and it needs complete testing, contrary to the > unchecked return values fixes. > > So I wouldn't bother converting a driver unless you can test it. See > what happened with the adm1026 driver, you converted it long ago, > nobody ever tested it, and now the patch is discarded as it conflicts > with other changes. > > Indeed - Nobody knew the patch was there, and I just discovered a potential tester for it on-list just last week. Hence this email ;-) .. and happily, this conversation. Im hoping (against experience) that by doing these: - identify drivers using macro repeated function defns - show how to find the lines to look at (the above grep) - discuss the technique ( 'dynamic' doesnt explain it, at least for me) .. that I/we can lower the barrier to participation. The task is still somewhat harder than the average janitorial patch, (which may attract would-be hackers), and of course there are the testing / validation issues (must have hardware).