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