Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1549411 > unrolled thread

hwmon: w83781d: Unused sysfs group w83781d_group_other

Started byAlexey Khoroshilov <khoroshilov@ispras.ru>
First post2017-01-02 23:00 +0100
Last post2017-01-03 05:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  hwmon: w83781d: Unused sysfs group w83781d_group_other Alexey Khoroshilov <khoroshilov@ispras.ru> - 2017-01-02 23:00 +0100
    Re: hwmon: w83781d: Unused sysfs group w83781d_group_other Guenter Roeck <linux@roeck-us.net> - 2017-01-03 05:30 +0100

#1549411 — hwmon: w83781d: Unused sysfs group w83781d_group_other

FromAlexey Khoroshilov <khoroshilov@ispras.ru>
Date2017-01-02 23:00 +0100
Subjecthwmon: w83781d: Unused sysfs group w83781d_group_other
Message-ID<sViO5-4Eo-1@gated-at.bofh.it>
Hello,

w83781d.c contains a definition of sysfs group:

static const struct attribute_group w83781d_group_other = {
	.attrs = w83781d_attributes_other,
};

the only usage of which is:

static void w83781d_remove_files(struct device *dev)
{
	...
	sysfs_remove_group(&dev->kobj, &w83781d_group_other);
}

So, it seems the group should be either created in w83781d_create_files() or removed completely.
What do you think?

Found by Linux Driver Verification project (linuxtesting.org).

--
Alexey Khoroshilov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org

[toc] | [next] | [standalone]


#1549527

FromGuenter Roeck <linux@roeck-us.net>
Date2017-01-03 05:30 +0100
Message-ID<sVoTv-D2-1@gated-at.bofh.it>
In reply to#1549411
On 01/02/2017 01:49 PM, Alexey Khoroshilov wrote:
> Hello,
>
> w83781d.c contains a definition of sysfs group:
>
> static const struct attribute_group w83781d_group_other = {
> 	.attrs = w83781d_attributes_other,
> };
>
> the only usage of which is:
>
> static void w83781d_remove_files(struct device *dev)
> {
> 	...
> 	sysfs_remove_group(&dev->kobj, &w83781d_group_other);
> }
>
> So, it seems the group should be either created in w83781d_create_files() or removed completely.
> What do you think?
>

If you look very closely, you'll see that the attributes are created individually
using  device_create_file(). Given that, removing the group might not be such a
good idea.

Yes, this is messy. If you have the time, feel free to convert the driver to use
hwmon_device_register_with_groups() or, even better, hwmon_device_register_with_info().

Thanks,
Guenter

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web