Skip to contentSkip to conversation

atlx: make strings const

PATCH Applied Stephen Hemminger 3 participants 4 messages Sep 8, 2010 – Sep 9, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atlx: make strings const

drivers/net/atlx/atl2.c +3 -3
@@ -51,10 +51,10 @@
 
 #define ATL2_DRV_VERSION "2.2.3"
 
-static char atl2_driver_name[] = "atl2";
+static const char atl2_driver_name[] = "atl2";
 static const char atl2_driver_string[] = "Atheros(R) L2 Ethernet Driver";
-static char atl2_copyright[] = "Copyright (c) 2007 Atheros Corporation.";
-static char atl2_driver_version[] = ATL2_DRV_VERSION;
+static const char atl2_copyright[] = "Copyright (c) 2007 Atheros Corporation.";
+static const char atl2_driver_version[] = ATL2_DRV_VERSION;
 
 MODULE_AUTHOR("Atheros Corporation <[email protected]>, Chris Snook <[email protected]>");
 MODULE_DESCRIPTION("Atheros Fast Ethernet Network Driver");
#2 lore raw
Quoted 7 lines · On Wed, 08 Sep 2010 15:58:11 -0700 Joe Perches <[email protected]> wrote:
Quoted 3 lines · Stephen Hemminger

Shouldn't that be done with all of the global
static char foo[] = "bar"; declarations?

Yes, that what I was looking at when I found some of these. Those that are __initdata don't matter as much since they get dropped (although they could be changed to __initconst).