icuv: make iucv_bus const
Subsystems (4)
PATCH 1/1 icuv: make iucv_bus const
Now that the driver core can properly handle constant struct bus_type, move the iucv_bus variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- include/net/iucv/iucv.h | 4 ++-- net/iucv/iucv.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
include/net/iucv/iucv.h +2 -2
@@ -80,7 +80,7 @@ struct iucv_array {u32 length; } __attribute__ ((aligned (8))); -extern struct bus_type iucv_bus; +extern const struct bus_type iucv_bus;extern struct device *iucv_root;/*
@@ -489,7 +489,7 @@ struct iucv_interface {int (*path_sever)(struct iucv_path *path,u8 userdata[16 ]);int (*iucv_register)(struct iucv_handler *handler,int smp);void (*iucv_unregister)(struct iucv_handler *handler,int smp); -struct bus_type *bus; +const struct bus_type *bus;struct device *root; };
net/iucv/iucv.c +1 -1
@@ -67,7 +67,7 @@ static int iucv_bus_match(struct device *dev, struct device_driver *drv)return 0 ; } -struct bus_type iucv_bus = { +const struct bus_type iucv_bus = { .name ="iucv" , .match = iucv_bus_match, };
Signature · 1 line
2.43.0
Quoted 13 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move theiucv_busvariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc Alexandra Winter <[email protected]>Cc Wenjia Zhang <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 1 line
---
Quoted 13 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move theiucv_busvariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc Alexandra Winter <[email protected]>Cc Wenjia Zhang <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 1 line
---
Nit: There seems to be a typo in the subject line s/icuv/iucv/
Quoted 16 lines · Niklas Schnelle
Quoted 13 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move theiucv_busvariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc Alexandra Winter <[email protected]>Cc Wenjia Zhang <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Quoted 1 line
---
Quoted 1 line
Nit: There seems to be a typo in the subject line s/icuv/iucv/
Ugh, good catch, let me go send a v2, thanks!
greg k-h