Skip to contentSkip to conversation

sh: sq: use default_groups in kobj_type

PATCH In review Greg Kroah-Hartman 2 participants 5 messages Jan 4, 2022 – Jan 5, 2022 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: sq: use default_groups in kobj_type

There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the sh sq sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field.

---
 arch/sh/kernel/cpu/sh4/sq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/sh/kernel/cpu/sh4/sq.c +2 -1
index d432164b23b7..a76b94e41e91 100644
@@ -324,6 +324,7 @@ static struct attribute *sq_sysfs_attrs[] = {
 	&mapping_attr.attr,
 	NULL,
 };
+ATTRIBUTE_GROUPS(sq_sysfs);
 
 static const struct sysfs_ops sq_sysfs_ops = {
 	.show	= sq_sysfs_show,
@@ -332,7 +333,7 @@ static const struct sysfs_ops sq_sysfs_ops = {
 
 static struct kobj_type ktype_percpu_entry = {
 	.sysfs_ops	= &sq_sysfs_ops,
-	.default_attrs	= sq_sysfs_attrs,
+	.default_groups	= sq_sysfs_groups,
 };
 
 static int sq_dev_add(struct device *dev, struct subsys_interface *sif)
Signature · 1 line
2.34.1
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Greg Kroah-Hartman

There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the sh sq sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field.

Let's see, sh4-specific, depends on CONFIG_SH_STORE_QUEUES... it built but I'm not finding an "sq" entry under /proc. (Or anything with "mapping" in it...)

Oh well, probably right? Didn't break anything for me:

Rob

#2 lore raw
Quoted 8 lines · Rob Landley
Quoted 6 lines · Greg Kroah-Hartman

There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the sh sq sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field.

Quoted 6 lines

Let's see, sh4-specific, depends on CONFIG_SH_STORE_QUEUES... it built but I'm not finding an "sq" entry under /proc. (Or anything with "mapping" in it...)

Oh well, probably right? Didn't break anything for me:

Thanks! Seems to pass 0-day testing as well :)

Should I take this in my tree?

greg k-h

#3 lore raw
Quoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Rob Landley
Quoted 6 lines · Greg Kroah-Hartman

There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the sh sq sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field.

Let's see, sh4-specific, depends on CONFIG_SH_STORE_QUEUES... it built but I'm not finding an "sq" entry under /proc. (Or anything with "mapping" in it...)

Quoted 7 lines
Quoted 3 lines

Oh well, probably right? Didn't break anything for me:

Thanks! Seems to pass 0-day testing as well :)

Should I take this in my tree?

Yes please.

Rob

#4 lore raw
Quoted 15 lines · Rob Landley
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Rob Landley
Quoted 6 lines · Greg Kroah-Hartman

There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the sh sq sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field.

Let's see, sh4-specific, depends on CONFIG_SH_STORE_QUEUES... it built but I'm not finding an "sq" entry under /proc. (Or anything with "mapping" in it...)

Oh well, probably right? Didn't break anything for me:

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Thanks! Seems to pass 0-day testing as well :)

Should I take this in my tree?

Yes please.

Wonderful, will go do that now.

greg k-h