浏览代码

net: fix warning about non-const string

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

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger 16 年之前
父节点
当前提交
a2205472c3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/core/net-sysfs.c

+ 1 - 1
net/core/net-sysfs.c

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