Re: [PATCH v3 1/1] hwmon: (k8temp) update to use new hwmon registration API

From: Guenter Roeck
Date: Sun Jul 21 2019 - 20:05:48 EST


On 7/21/19 1:37 PM, avoidr@xxxxxxxxxx wrote:
On 2019-07-21 17:14, Guenter Roeck wrote:
On Sun, Jul 21, 2019 at 02:00:51PM +0200, Robert Karszniewicz wrote:
Removes:
- hwmon_dev from k8temp_data struct, as that is now passed
to callbacks, anyway.
- other k8temp_data struct fields, too.
- k8temp_update_device()

Also reduces binary size:
text data bss dec hex filename
4139 1448 0 5587 15d3 drivers/hwmon/k8temp.ko.bak
3103 1220 0 4323 10e3 drivers/hwmon/k8temp.ko

Signed-off-by: Robert Karszniewicz <avoidr@xxxxxxxxxxx>
Signed-off-by: Robert Karszniewicz <avoidr@xxxxxxxxxx>

Applied.

Thank you! It's been a joy!

---
Changes from v2:
- if (data->swap_core_select)
- core ^= 1;
+ core ^= data->swap_core_select;

However, that produces slightly more .text than v2, and is a tad too
"tricky", I personally find.

Interesting - for me it produces ~30 bytes less code (with gcc 7.4.0).

Strange. I just verified to make sure and I do get ~30 bytes /more/ code
(with gcc 9.1.0).


Mine is gcc 7.4.0. Oh well...

Guenter