Messages in this thread | | | Subject | Re: [PATCH] hwmon: (ibmpowernv) Add min/max attributes and current sensors | From | Cédric Le Goater <> | Date | Tue, 25 Apr 2017 16:34:32 +0200 |
| |
...
> + sdata[count].id = sensor_id; > + sdata[count].type = type; > + sdata[count].hwmon_index = sdata[count - 1].hwmon_index; > + create_hwmon_attr(&sdata[count], attr_name, > + show_sensor); > + pgroups[type]->attrs[sensor_groups[type].attr_count++] = > + &sdata[count++].dev_attr.attr; > + }
We are duplicating these lines at least three times. I wonder if we could make a routine for them. Don't bother doing so if the number of arguments is too large.
Thanks,
C.
| |