Re: [PATCH 2/3] hwmon: (coretemp) Remove unnecessary dependency of array index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > >         mutex_lock(&tdata->update_lock);
> > > @@ -445,7 +441,6 @@ static int create_core_attrs(struct temp_data
> > > *tdata, struct device *dev,
> > >                 tdata->sd_attrs[i].dev_attr.attr.name = tdata-
> > > >attr_name[i];
> > >                 tdata->sd_attrs[i].dev_attr.attr.mode = 0444;
> > >                 tdata->sd_attrs[i].dev_attr.show = rd_ptr[i];
> > > -               tdata->sd_attrs[i].index = attr_no;
> > 
> > I was naively thinking if we could nuke that "index". I can see
> > that used
> > in couple macros, but seems like we can lose it?
> > 
> > Completely untested.. and uncertain :-)
> > 
> 
> If you had suggested to replace
>         struct sensor_device_attribute sd_attrs[TOTAL_ATTRS];
> with
>         struct device_attribute sd_attrs[TOTAL_ATTRS];
> what you suggested may actually be possible and make sense.

Too late for me today.
Let me check if I can convert it to use device_attribute instead
tomorrow.

thanks,
rui





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux