drm/xe: make kobject type struct as constant
authorTejas Upadhyay <tejas.upadhyay@intel.com>
Mon, 3 Jul 2023 09:06:10 +0000 (14:36 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:35:15 +0000 (11:35 -0500)
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.

Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt_sysfs.c

index cdfe5995259b202a1c70d1de2b92a569f3bf0895..b955940e8dc6d7e10ad9cb0051b4e0ebef8f11f8 100644 (file)
@@ -17,7 +17,7 @@ static void xe_gt_sysfs_kobj_release(struct kobject *kobj)
        kfree(kobj);
 }
 
-static struct kobj_type xe_gt_sysfs_kobj_type = {
+static const struct kobj_type xe_gt_sysfs_kobj_type = {
        .release = xe_gt_sysfs_kobj_release,
        .sysfs_ops = &kobj_sysfs_ops,
 };