lkml.org 
[lkml]   [2024]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] parport: constify the struct device_type usage
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
parport_device_type 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>
---
drivers/parport/share.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 49c74ded8a53..33159392d70c 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -101,7 +101,7 @@ static struct parport_operations dead_ops = {
.owner = NULL,
};

-static struct device_type parport_device_type = {
+static const struct device_type parport_device_type = {
.name = "parport",
};

---
base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d
change-id: 20240219-device_cleanup-parport-ba048a859198
Best regards,
--
Ricardo B. Marliere <ricardo@marliere.net>


\
 
 \ /
  Last update: 2024-05-27 15:10    [W:0.139 / U:0.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site