acpi_power_meter: clean up duplicate code
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | acpi_power_meter: use the same struct {rw, ro}_sensor_template for bothdrivers/ | +109 | 0 replies | |
| 2/5 | acpi_power_meter: use a {RW, RO}_SENSOR_TEMPLATE macro to clean things updrivers/ | +37 | 0 replies | |
| 3/5 | acpi_power_meter: remove duplicate code between register_{ro, rw}_attrsdrivers/ | +17 | 0 replies | |
| 4/5 | acpi_power_meter: drop meter_rw_attrs, use common meter_attrsdrivers/ | +2 | 0 replies | |
| 5/5 | acpi_power_meter: clean up code around setup_attrsdrivers/ | +7 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [lm-sensors] [PATCH 0/5] acpi_power_meter: clean up duplicate code
From: Kyle McMartin <[email protected]>
acpi_power_meter currently duplicates a lot of code between the rw and ro sensor templates unnecessarily. The attached five part series cleans things up to use the same code path for both, deciding which is which by the use of the .set field.
Additionally, (imho at least) it makes the struct initializers a bit more pretty and uses a macro to reduce the repetition of each member.
It's been compile tested across the series for bisectability, but I do not currently have access to any device which uses this driver for testing.
regards, Kyle McMartin
Kyle McMartin (5):
acpi_power_meter: use the same struct {rw,ro}_sensor_template for
both
acpi_power_meter: use a {RW,RO}_SENSOR_TEMPLATE macro to clean things
up
acpi_power_meter: remove duplicate code between
register_{ro,rw}_attrs
acpi_power_meter: drop meter_rw_attrs, use common meter_attrs
acpi_power_meter: clean up code around setup_attrs
drivers/hwmon/acpi_power_meter.c | 165 +++++++++++++++++--------------------- 1 files changed, 72 insertions(+), 93 deletions(-)
Signature · 7 lines
1.7.7.6 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors