Xen-Devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: sysfs: make kobj_type structure constant
@ 2023-02-16  1:10 Thomas Weißschuh
  2023-02-18  8:45 ` Juergen Gross
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Weißschuh @ 2023-02-16  1:10 UTC (permalink / raw
  To: Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko
  Cc: xen-devel, linux-kernel, Thomas Weißschuh

Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.

Take advantage of this to constify the structure definition to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/xen/sys-hypervisor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index fcb0792f090e..ef62acb354a7 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -594,7 +594,7 @@ static const struct sysfs_ops hyp_sysfs_ops = {
 	.store = hyp_sysfs_store,
 };
 
-static struct kobj_type hyp_sysfs_kobj_type = {
+static const struct kobj_type hyp_sysfs_kobj_type = {
 	.sysfs_ops = &hyp_sysfs_ops,
 };
 

---
base-commit: 033c40a89f55525139fd5b6342281b09b97d05bf
change-id: 20230216-kobj_type-xen-d902500cb4ee

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>



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

* Re: [PATCH] xen: sysfs: make kobj_type structure constant
  2023-02-16  1:10 [PATCH] xen: sysfs: make kobj_type structure constant Thomas Weißschuh
@ 2023-02-18  8:45 ` Juergen Gross
  0 siblings, 0 replies; 2+ messages in thread
From: Juergen Gross @ 2023-02-18  8:45 UTC (permalink / raw
  To: Thomas Weißschuh, Stefano Stabellini, Oleksandr Tyshchenko
  Cc: xen-devel, linux-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 411 bytes --]

On 16.02.23 02:10, Thomas Weißschuh wrote:
> Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
> the driver core allows the usage of const struct kobj_type.
> 
> Take advantage of this to constify the structure definition to prevent
> modification at runtime.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

end of thread, other threads:[~2023-02-18  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-16  1:10 [PATCH] xen: sysfs: make kobj_type structure constant Thomas Weißschuh
2023-02-18  8:45 ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).