hwmon: Use HWMON_CHANNEL_INFO macro
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | hwmon: (adt7411) Use HWMON_CHANNEL_INFO macrodrivers/ | +15 | 0 replies | |
| 2/17 | hwmon: (ina3221) Use HWMON_CHANNEL_INFO macrodrivers/ | +15 | 0 replies | |
| 3/17 | hwmon: (jc42) Use HWMON_CHANNEL_INFO macrodrivers/ | +5 | 0 replies | |
| 4/17 | hwmon: (lm75) Use HWMON_CHANNEL_INFO macrodrivers/ | +4 | 0 replies | |
| 5/17 | hwmon: (lm90) Use HWMON_CHANNEL_INFO macrodrivers/ | +2 | 0 replies | |
| 6/17 | hwmon: (lm95241) Use HWMON_CHANNEL_INFO macrodrivers/ | +8 | 0 replies | |
| 7/17 | hwmon: (lm95245) Use HWMON_CHANNEL_INFO macrodrivers/ | +9 | 0 replies | |
| 8/17 | hwmon: (ltc4245) Use HWMON_CHANNEL_INFO macrodrivers/ | +23 | 0 replies | |
| 9/17 | hwmon: (ltq-cputemp) Use HWMON_CHANNEL_INFO macrodrivers/ | +4 | 0 replies | |
| 10/17 | hwmon: (max31790) Use HWMON_CHANNEL_INFO macrodrivers/ | +20 | 0 replies | |
| 11/17 | hwmon: (max6621) Use HWMON_CHANNEL_INFO macrodrivers/ | +12 | 0 replies | |
| 12/17 | hwmon: (mlxreg-fan) Use HWMON_CHANNEL_INFO macrodrivers/ | +15 | 0 replies | |
| 13/17 | hwmon: (npcm750-pwm-fan) Use HWMON_CHANNEL_INFO macrodrivers/ | +26 | 0 replies | |
| 14/17 | hwmon: (raspberrypi-hwmon) Use HWMON_CHANNEL_INFO macrodrivers/ | +2 | 0 replies | |
| 15/17 | hwmon: (tmp102) Use HWMON_CHANNEL_INFO macrodrivers/ | +4 | 0 replies | |
| 16/17 | hwmon: (tmp108) Use HWMON_CHANNEL_INFO macrodrivers/ | +6 | 0 replies | |
| 17/17 | hwmon: (w83773g) Use HWMON_CHANNEL_INFO macrodrivers/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/17] hwmon: Use HWMON_CHANNEL_INFO macro
The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. This series converts all hwmon drivers to use the macro if possible.
The conversion is done automatically with coccinelle. The semantic patch used to make this change is as follows.
@r@
initializer list elements;
identifier i;
@@
-u32 i[] = {
- elements,
- 0
-};
@s@
identifier r.i,j,ty;
@@
-struct hwmon_channel_info j = {
- .type = ty,
- .config = i,
-};
@script:ocaml t@
ty << s.ty;
elements << r.elements;
shorter;
elems;
@@
shorter :=
make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty)));
elems :=
make_ident
(String.concat ","
(List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x)
(Str.split (Str.regexp " , ") elements)))@@
identifier s.j,t.shorter;
identifier t.elems;
@@
- &j
+ HWMON_CHANNEL_INFO(shorter,elems)
The conversion does not introduce functional changes.
Many thanks to Julia Lawall for providing the semantic patch.