From: Ricardo B. Marliere Date: Sat, 17 Feb 2024 20:13:25 +0000 (-0300) Subject: net: bridge: constify the struct device_type usage X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bbc7e4cc21a43d7991a5c9a163d2990daddc8411;p=linux.git net: bridge: 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 br_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 Signed-off-by: Ricardo B. Marliere Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 717e9750614cd..874cec75a818e 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -474,7 +474,7 @@ static const struct net_device_ops br_netdev_ops = { .ndo_fill_forward_path = br_fill_forward_path, }; -static struct device_type br_type = { +static const struct device_type br_type = { .name = "bridge", };