net: bridge: constify the struct device_type usage
authorRicardo B. Marliere <ricardo@marliere.net>
Sat, 17 Feb 2024 20:13:25 +0000 (17:13 -0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Feb 2024 09:45:23 +0000 (09:45 +0000)
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 <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_device.c

index 717e9750614cdbb68b612688d94ffcd62fb929b7..874cec75a818e029c6914a01b426b3e5c59ddd16 100644 (file)
@@ -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",
 };