diff mbox series

[06/12] net: geneve: constify the struct device_type usage

Message ID 20240217-device_cleanup-net-v1-6-1eb31fb689f7@marliere.net (mailing list archive)
State Accepted
Commit e443f3acbc6d9ac4f7b138833cc93319294f58e3
Headers show
Series net: constify struct device_type usage | expand

Commit Message

Ricardo B. Marliere Feb. 17, 2024, 8:13 p.m. UTC
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the geneve_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>
---
 drivers/net/geneve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guillaume Nault Feb. 19, 2024, 11:45 a.m. UTC | #1
On Sat, Feb 17, 2024 at 05:13:28PM -0300, Ricardo B. Marliere wrote:
> Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
> core can properly handle constant struct device_type. Move the geneve_type
> variable to be a constant structure as well, placing it into read-only
> memory which can not be modified at runtime.

Reviewed-by: Guillaume Nault <gnault@redhat.com>
diff mbox series

Patch

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 256602a72356..6f3f9b446b1d 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1142,7 +1142,7 @@  static const struct ethtool_ops geneve_ethtool_ops = {
 };
 
 /* Info for udev, that this is a virtual tunnel endpoint */
-static struct device_type geneve_type = {
+static const struct device_type geneve_type = {
 	.name = "geneve",
 };