Skip to contentSkip to conversation

net: fix warning about non-const string

PATCH New Stephen Hemminger 1 participant 1 message Mar 9, 2009

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

PATCH 1/1 net: fix warning about non-const string

Since dev_set_name takes a printf style string, new gcc complains if arg is not const.

net/core/net-sysfs.c +1 -1
@@ -498,7 +498,7 @@ int netdev_register_kobject(struct net_d
 	dev->groups = groups;
 
 	BUILD_BUG_ON(BUS_ID_SIZE < IFNAMSIZ);
-	dev_set_name(dev, net->name);
+	dev_set_name(dev, "%s", net->name);
 
 #ifdef CONFIG_SYSFS
 	*groups++ = &netstat_group;