From: Ricardo B. Marliere Date: Sun, 4 Feb 2024 20:16:34 +0000 (-0300) Subject: netdevsim: make nsim_bus const X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=56b93cd358b304b2d1945c0330dffe8f872bc0d3;p=linux.git netdevsim: make nsim_bus const Now that the driver core can properly handle constant struct bus_type, move the nsim_bus 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 Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Greg Kroah-Hartman Signed-off-by: David S. Miller --- diff --git a/drivers/net/netdevsim/bus.c b/drivers/net/netdevsim/bus.c index bcbc1e19edde4..aedab1d9623a1 100644 --- a/drivers/net/netdevsim/bus.c +++ b/drivers/net/netdevsim/bus.c @@ -260,7 +260,7 @@ static int nsim_num_vf(struct device *dev) return nsim_bus_dev->num_vfs; } -static struct bus_type nsim_bus = { +static const struct bus_type nsim_bus = { .name = DRV_NAME, .dev_name = DRV_NAME, .bus_groups = nsim_bus_groups,