提交 4b704d59 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

tipc: fix non-const printf format arguments

Fix warnings from current gcc about using non-const strings as printf
args in TIPC. Compile tested only (not a TIPC user).
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 beedad92
...@@ -119,7 +119,7 @@ static struct bclink *bclink = NULL; ...@@ -119,7 +119,7 @@ static struct bclink *bclink = NULL;
static struct link *bcl = NULL; static struct link *bcl = NULL;
static DEFINE_SPINLOCK(bc_lock); static DEFINE_SPINLOCK(bc_lock);
char tipc_bclink_name[] = "multicast-link"; const char tipc_bclink_name[] = "multicast-link";
static u32 buf_seqno(struct sk_buff *buf) static u32 buf_seqno(struct sk_buff *buf)
...@@ -800,7 +800,7 @@ int tipc_bclink_init(void) ...@@ -800,7 +800,7 @@ int tipc_bclink_init(void)
tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT); tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT);
bcl->b_ptr = &bcbearer->bearer; bcl->b_ptr = &bcbearer->bearer;
bcl->state = WORKING_WORKING; bcl->state = WORKING_WORKING;
sprintf(bcl->name, tipc_bclink_name); strlcpy(bcl->name, tipc_bclink_name, TIPC_MAX_LINK_NAME);
if (BCLINK_LOG_BUF_SIZE) { if (BCLINK_LOG_BUF_SIZE) {
char *pb = kmalloc(BCLINK_LOG_BUF_SIZE, GFP_ATOMIC); char *pb = kmalloc(BCLINK_LOG_BUF_SIZE, GFP_ATOMIC);
......
...@@ -70,7 +70,7 @@ struct port_list { ...@@ -70,7 +70,7 @@ struct port_list {
struct tipc_node; struct tipc_node;
extern char tipc_bclink_name[]; extern const char tipc_bclink_name[];
/** /**
......
...@@ -258,7 +258,7 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...) ...@@ -258,7 +258,7 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...)
} }
if (pb->echo) if (pb->echo)
printk(print_string); printk("%s", print_string);
spin_unlock_bh(&print_lock); spin_unlock_bh(&print_lock);
} }
......
...@@ -703,7 +703,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space) ...@@ -703,7 +703,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
link_info.dest = htonl(tipc_own_addr & 0xfffff00); link_info.dest = htonl(tipc_own_addr & 0xfffff00);
link_info.up = htonl(1); link_info.up = htonl(1);
sprintf(link_info.str, tipc_bclink_name); strlcpy(link_info.str, tipc_bclink_name, TIPC_MAX_LINK_NAME);
tipc_cfg_append_tlv(buf, TIPC_TLV_LINK_INFO, &link_info, sizeof(link_info)); tipc_cfg_append_tlv(buf, TIPC_TLV_LINK_INFO, &link_info, sizeof(link_info));
/* Add TLVs for any other links in scope */ /* Add TLVs for any other links in scope */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册