]> www.infradead.org Git - nvme.git/commitdiff
accel: constify the struct device_type usage
authorRicardo B. Marliere <ricardo@marliere.net>
Mon, 19 Feb 2024 19:48:28 +0000 (16:48 -0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 26 Feb 2024 07:59:18 +0000 (09:59 +0200)
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
accel_sysfs_device_minor variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/drm_accel.c

index 24cac4c0274bb665a35274216726b4e80488bea6..16c3edb8c46ee1c62954bf025d618419cca93638 100644 (file)
@@ -23,7 +23,7 @@ static struct idr accel_minors_idr;
 
 static struct dentry *accel_debugfs_root;
 
-static struct device_type accel_sysfs_device_minor = {
+static const struct device_type accel_sysfs_device_minor = {
        .name = "accel_minor"
 };