All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu_fw_cfg: use default_groups in kobj_type
@ 2022-01-05 18:31 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-01-05 18:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Gabriel Somlo, Michael S. Tsirkin, qemu-devel

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 firmware qemu_fw_cfg 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.

Cc: Gabriel Somlo <somlo@cmu.edu>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/firmware/qemu_fw_cfg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
index 172c751a4f6c..c62f05420d32 100644
--- a/drivers/firmware/qemu_fw_cfg.c
+++ b/drivers/firmware/qemu_fw_cfg.c
@@ -395,7 +395,7 @@ static void fw_cfg_sysfs_cache_cleanup(void)
 	}
 }
 
-/* default_attrs: per-entry attributes and show methods */
+/* per-entry attributes and show methods */
 
 #define FW_CFG_SYSFS_ATTR(_attr) \
 struct fw_cfg_sysfs_attribute fw_cfg_sysfs_attr_##_attr = { \
@@ -428,6 +428,7 @@ static struct attribute *fw_cfg_sysfs_entry_attrs[] = {
 	&fw_cfg_sysfs_attr_name.attr,
 	NULL,
 };
+ATTRIBUTE_GROUPS(fw_cfg_sysfs_entry);
 
 /* sysfs_ops: find fw_cfg_[entry, attribute] and call appropriate show method */
 static ssize_t fw_cfg_sysfs_attr_show(struct kobject *kobj, struct attribute *a,
@@ -454,7 +455,7 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj)
 
 /* kobj_type: ties together all properties required to register an entry */
 static struct kobj_type fw_cfg_sysfs_entry_ktype = {
-	.default_attrs = fw_cfg_sysfs_entry_attrs,
+	.default_groups = fw_cfg_sysfs_entry_groups,
 	.sysfs_ops = &fw_cfg_sysfs_attr_ops,
 	.release = fw_cfg_sysfs_release_entry,
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] qemu_fw_cfg: use default_groups in kobj_type
@ 2022-01-05 18:31 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-01-05 18:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Gabriel Somlo, qemu-devel, Michael S. Tsirkin

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 firmware qemu_fw_cfg 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.

Cc: Gabriel Somlo <somlo@cmu.edu>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/firmware/qemu_fw_cfg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
index 172c751a4f6c..c62f05420d32 100644
--- a/drivers/firmware/qemu_fw_cfg.c
+++ b/drivers/firmware/qemu_fw_cfg.c
@@ -395,7 +395,7 @@ static void fw_cfg_sysfs_cache_cleanup(void)
 	}
 }
 
-/* default_attrs: per-entry attributes and show methods */
+/* per-entry attributes and show methods */
 
 #define FW_CFG_SYSFS_ATTR(_attr) \
 struct fw_cfg_sysfs_attribute fw_cfg_sysfs_attr_##_attr = { \
@@ -428,6 +428,7 @@ static struct attribute *fw_cfg_sysfs_entry_attrs[] = {
 	&fw_cfg_sysfs_attr_name.attr,
 	NULL,
 };
+ATTRIBUTE_GROUPS(fw_cfg_sysfs_entry);
 
 /* sysfs_ops: find fw_cfg_[entry, attribute] and call appropriate show method */
 static ssize_t fw_cfg_sysfs_attr_show(struct kobject *kobj, struct attribute *a,
@@ -454,7 +455,7 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj)
 
 /* kobj_type: ties together all properties required to register an entry */
 static struct kobj_type fw_cfg_sysfs_entry_ktype = {
-	.default_attrs = fw_cfg_sysfs_entry_attrs,
+	.default_groups = fw_cfg_sysfs_entry_groups,
 	.sysfs_ops = &fw_cfg_sysfs_attr_ops,
 	.release = fw_cfg_sysfs_release_entry,
 };
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] qemu_fw_cfg: use default_groups in kobj_type
  2022-01-05 18:31 ` Greg Kroah-Hartman
@ 2022-01-05 22:56   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-01-05 22:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Gabriel Somlo, qemu-devel

On Wed, Jan 05, 2022 at 07:31:33PM +0100, Greg Kroah-Hartman wrote:
> 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 firmware qemu_fw_cfg 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.
> 
> Cc: Gabriel Somlo <somlo@cmu.edu>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: qemu-devel@nongnu.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

OK then you know best I guess

Acked-by: Michael S. Tsirkin <mst@redhat.com>

feel free to queue.

> ---
>  drivers/firmware/qemu_fw_cfg.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
> index 172c751a4f6c..c62f05420d32 100644
> --- a/drivers/firmware/qemu_fw_cfg.c
> +++ b/drivers/firmware/qemu_fw_cfg.c
> @@ -395,7 +395,7 @@ static void fw_cfg_sysfs_cache_cleanup(void)
>  	}
>  }
>  
> -/* default_attrs: per-entry attributes and show methods */
> +/* per-entry attributes and show methods */
>  
>  #define FW_CFG_SYSFS_ATTR(_attr) \
>  struct fw_cfg_sysfs_attribute fw_cfg_sysfs_attr_##_attr = { \
> @@ -428,6 +428,7 @@ static struct attribute *fw_cfg_sysfs_entry_attrs[] = {
>  	&fw_cfg_sysfs_attr_name.attr,
>  	NULL,
>  };
> +ATTRIBUTE_GROUPS(fw_cfg_sysfs_entry);
>  
>  /* sysfs_ops: find fw_cfg_[entry, attribute] and call appropriate show method */
>  static ssize_t fw_cfg_sysfs_attr_show(struct kobject *kobj, struct attribute *a,
> @@ -454,7 +455,7 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj)
>  
>  /* kobj_type: ties together all properties required to register an entry */
>  static struct kobj_type fw_cfg_sysfs_entry_ktype = {
> -	.default_attrs = fw_cfg_sysfs_entry_attrs,
> +	.default_groups = fw_cfg_sysfs_entry_groups,
>  	.sysfs_ops = &fw_cfg_sysfs_attr_ops,
>  	.release = fw_cfg_sysfs_release_entry,
>  };
> -- 
> 2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qemu_fw_cfg: use default_groups in kobj_type
@ 2022-01-05 22:56   ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-01-05 22:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Gabriel Somlo, linux-kernel, qemu-devel

On Wed, Jan 05, 2022 at 07:31:33PM +0100, Greg Kroah-Hartman wrote:
> 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 firmware qemu_fw_cfg 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.
> 
> Cc: Gabriel Somlo <somlo@cmu.edu>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: qemu-devel@nongnu.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

OK then you know best I guess

Acked-by: Michael S. Tsirkin <mst@redhat.com>

feel free to queue.

> ---
>  drivers/firmware/qemu_fw_cfg.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
> index 172c751a4f6c..c62f05420d32 100644
> --- a/drivers/firmware/qemu_fw_cfg.c
> +++ b/drivers/firmware/qemu_fw_cfg.c
> @@ -395,7 +395,7 @@ static void fw_cfg_sysfs_cache_cleanup(void)
>  	}
>  }
>  
> -/* default_attrs: per-entry attributes and show methods */
> +/* per-entry attributes and show methods */
>  
>  #define FW_CFG_SYSFS_ATTR(_attr) \
>  struct fw_cfg_sysfs_attribute fw_cfg_sysfs_attr_##_attr = { \
> @@ -428,6 +428,7 @@ static struct attribute *fw_cfg_sysfs_entry_attrs[] = {
>  	&fw_cfg_sysfs_attr_name.attr,
>  	NULL,
>  };
> +ATTRIBUTE_GROUPS(fw_cfg_sysfs_entry);
>  
>  /* sysfs_ops: find fw_cfg_[entry, attribute] and call appropriate show method */
>  static ssize_t fw_cfg_sysfs_attr_show(struct kobject *kobj, struct attribute *a,
> @@ -454,7 +455,7 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj)
>  
>  /* kobj_type: ties together all properties required to register an entry */
>  static struct kobj_type fw_cfg_sysfs_entry_ktype = {
> -	.default_attrs = fw_cfg_sysfs_entry_attrs,
> +	.default_groups = fw_cfg_sysfs_entry_groups,
>  	.sysfs_ops = &fw_cfg_sysfs_attr_ops,
>  	.release = fw_cfg_sysfs_release_entry,
>  };
> -- 
> 2.34.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qemu_fw_cfg: use default_groups in kobj_type
  2022-01-05 22:56   ` Michael S. Tsirkin
@ 2022-01-06 13:25     ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-01-06 13:25 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: linux-kernel, Gabriel Somlo, qemu-devel

On Wed, Jan 05, 2022 at 05:56:26PM -0500, Michael S. Tsirkin wrote:
> On Wed, Jan 05, 2022 at 07:31:33PM +0100, Greg Kroah-Hartman wrote:
> > 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 firmware qemu_fw_cfg 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.
> > 
> > Cc: Gabriel Somlo <somlo@cmu.edu>
> > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > Cc: qemu-devel@nongnu.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> OK then you know best I guess
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> 
> feel free to queue.

Thanks, will do!

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] qemu_fw_cfg: use default_groups in kobj_type
@ 2022-01-06 13:25     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-01-06 13:25 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Gabriel Somlo, linux-kernel, qemu-devel

On Wed, Jan 05, 2022 at 05:56:26PM -0500, Michael S. Tsirkin wrote:
> On Wed, Jan 05, 2022 at 07:31:33PM +0100, Greg Kroah-Hartman wrote:
> > 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 firmware qemu_fw_cfg 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.
> > 
> > Cc: Gabriel Somlo <somlo@cmu.edu>
> > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > Cc: qemu-devel@nongnu.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> OK then you know best I guess
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> 
> feel free to queue.

Thanks, will do!

greg k-h


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-06 14:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 18:31 [PATCH] qemu_fw_cfg: use default_groups in kobj_type Greg Kroah-Hartman
2022-01-05 18:31 ` Greg Kroah-Hartman
2022-01-05 22:56 ` Michael S. Tsirkin
2022-01-05 22:56   ` Michael S. Tsirkin
2022-01-06 13:25   ` Greg Kroah-Hartman
2022-01-06 13:25     ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.