Re: [PATCH] hwmon: (ibmpowernv) Add min/max attributes and current sensors

From: CÃdric Le Goater
Date: Tue Apr 25 2017 - 11:27:49 EST


...

> + 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.