Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-buf: make kobj_type structure constant

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: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230217-kobj_type-dma-buf-v1-1-b84a3616522c@weissschuh.net

authored by

Thomas Weißschuh and committed by
Christian König
c2f2c721 158350aa

+1 -1
+1 -1
drivers/dma-buf/dma-buf-sysfs-stats.c
··· 112 112 kfree(sysfs_entry); 113 113 } 114 114 115 - static struct kobj_type dma_buf_ktype = { 115 + static const struct kobj_type dma_buf_ktype = { 116 116 .sysfs_ops = &dma_buf_stats_sysfs_ops, 117 117 .release = dma_buf_sysfs_release, 118 118 .default_groups = dma_buf_stats_default_groups,