net: ppp: constify the struct device_type usage
authorRicardo B. Marliere <ricardo@marliere.net>
Sat, 17 Feb 2024 20:13:27 +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 ppp_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: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ppp/ppp_generic.c

index 3dd52bf28f15bf9f260719f1bf61e45d6d48b3f7..db1d11ae817b11492adfd22d0453ff7e1f22d48a 100644 (file)
@@ -1607,7 +1607,7 @@ static const struct net_device_ops ppp_netdev_ops = {
        .ndo_fill_forward_path = ppp_fill_forward_path,
 };
 
-static struct device_type ppp_type = {
+static const struct device_type ppp_type = {
        .name = "ppp",
 };