netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] net/tipc: sprintf/strcpy conversion
@ 2006-11-01 14:06 Florian Westphal
  2006-11-01 21:38 ` [KJ] " walter harms
  2006-11-03  0:09 ` [KJ] " Alexey Dobriyan
  0 siblings, 2 replies; 8+ messages in thread
From: Florian Westphal @ 2006-11-01 14:06 UTC (permalink / raw)
  To: kernel-janitors; +Cc: tipc-discussion, netdev

From: Florian Westphal <fw@strlen.de>

convert sprintf(a,b) to strcpy(a,b). Make tipc_bclink_name[] const.

Signed-off-by: Florian Westphal <fw@strlen.de>

---

compile tested; diffed against davem/net-2.6.

--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -119,7 +119,7 @@ static struct bclink *bclink = NULL;
 static struct link *bcl = NULL;
 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)
@@ -790,7 +790,7 @@ int tipc_bclink_init(void)
 	INIT_LIST_HEAD(&bcbearer->bearer.cong_links);
 	bcbearer->bearer.media = &bcbearer->media;
 	bcbearer->media.send_msg = tipc_bcbearer_send;
-	sprintf(bcbearer->media.name, "tipc-multicast");
+	strcpy(bcbearer->media.name, "tipc-multicast");
 
 	bcl = &bclink->link;
 	memset(bclink, 0, sizeof(struct bclink));
@@ -802,7 +802,7 @@ int tipc_bclink_init(void)
 	tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT);
 	bcl->b_ptr = &bcbearer->bearer;
 	bcl->state = WORKING_WORKING;
-	sprintf(bcl->name, tipc_bclink_name);
+	strcpy(bcl->name, tipc_bclink_name);
 
 	if (BCLINK_LOG_BUF_SIZE) {
 		char *pb = kmalloc(BCLINK_LOG_BUF_SIZE, GFP_ATOMIC);
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h
--- a/net/tipc/bcast.h
+++ b/net/tipc/bcast.h
@@ -70,7 +70,7 @@ struct port_list {
 
 struct node;
 
-extern char tipc_bclink_name[];
+extern const char tipc_bclink_name[];
 
 
 /**
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -667,7 +667,7 @@ struct sk_buff *tipc_node_get_links(cons
         link_info.dest = tipc_own_addr & 0xfffff00;
 	link_info.dest = htonl(link_info.dest);
         link_info.up = htonl(1);
-        sprintf(link_info.str, tipc_bclink_name);
+        strcpy(link_info.str, tipc_bclink_name);
 	tipc_cfg_append_tlv(buf, TIPC_TLV_LINK_INFO, &link_info, sizeof(link_info));
 
 	/* Add TLVs for any other links in scope */

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-11-03 10:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-01 14:06 [patch] net/tipc: sprintf/strcpy conversion Florian Westphal
2006-11-01 21:38 ` [KJ] " walter harms
2006-11-01 23:19   ` David Miller
2006-11-02  7:45     ` walter harms
2006-11-02  6:26   ` [tipc-discussion] " Florian Westphal
2006-11-02  7:57     ` [KJ] [tipc-discussion] " walter harms
2006-11-03  0:09 ` [KJ] " Alexey Dobriyan
2006-11-03 10:50   ` Hagen Paul Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).