Skip to content

Commit

Permalink
netdevsim: make nsim_bus const
Browse files Browse the repository at this point in the history
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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ricardo B. Marliere authored and David S. Miller committed Feb 7, 2024
1 parent 59d6bcc commit 56b93cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/netdevsim/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 56b93cd

Please sign in to comment.