On Fri, Jun 24, 2022 at 5:39 AM ChiYuan Huang <u0084500@xxxxxxxxx> wrote: > Andy Shevchenko <andy.shevchenko@xxxxxxxxx> 於 2022年6月19日 週日 下午6:38寫道: > > On Sat, Jun 18, 2022 at 5:16 PM ChiYuan Huang <u0084500@xxxxxxxxx> wrote: > > > Andy Shevchenko <andy.shevchenko@xxxxxxxxx> 於 2022年6月18日 週六 凌晨1:08寫道: > > > > On Fri, Jun 17, 2022 at 11:37 AM cy_huang <u0084500@xxxxxxxxx> wrote: ... > > > > > + struct device *dev; > > > > > + struct regmap *regmap; > > > > > > > > Swapping these two might give less code in the generated binary. Have > > > > you run bloat-o-meter? > > > > > > > I never know about this tool. > > > I'll check it before I submit the next revision. > > > Thanks for the reminding. > > > > > > But from Jonathan's reply, I may remove 'struct regmap *regmap'. > > > If all function need the 'regmap', a local variable 'regmap' need to > > > be declared. > > > To use struct regmap *regmap = dev_get_regmap(dev, NULL) is more effective. > > > > It's fine, but you may experiment with bloat-o-meter even in that case > > out of curiosity. > > > I tred to only swap these two line for *dev and *regmap. > Check the below two cases > 1. bloat-o-meter with rtq6056 as the builtin > add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) > Function old new delta > Total: Before=24428680, After=24428680, chg +0.00% > 2. size tool with rtq6056 as the kernel build > text data bss dec hex filename > 5261 1155 0 6416 1910 drivers/iio/adc/rtq6056-adc.ko.old > text data bss dec hex filename > 5261 1155 0 6416 1910 drivers/iio/adc/rtq6056-adc.ko > > It's weird that there's no difference. > > Do I misunderstand something? Nope, it means that in _current_ code this makes no change. Feel free to go with your variant if you prefer. -- With Best Regards, Andy Shevchenko