netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] caif: remove duplicate initialization
@ 2012-02-07  7:20 Dan Carpenter
  2012-02-07 18:39 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-02-07  7:20 UTC (permalink / raw)
  To: Sjur Braendeland; +Cc: David S. Miller, netdev, kernel-janitors

"priv" is initialized twice.  I kept the second one, because it is next
to the check for NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c
index a751d9b..e866234 100644
--- a/net/caif/chnl_net.c
+++ b/net/caif/chnl_net.c
@@ -72,13 +72,12 @@ static void robust_list_del(struct list_head *delete_node)
 static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt)
 {
 	struct sk_buff *skb;
-	struct chnl_net *priv  = container_of(layr, struct chnl_net, chnl);
+	struct chnl_net *priv;
 	int pktlen;
 	const u8 *ip_version;
 	u8 buf;
 
 	priv = container_of(layr, struct chnl_net, chnl);
-
 	if (!priv)
 		return -EINVAL;
 

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

* Re: [patch] caif: remove duplicate initialization
  2012-02-07  7:20 [patch] caif: remove duplicate initialization Dan Carpenter
@ 2012-02-07 18:39 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-02-07 18:39 UTC (permalink / raw)
  To: dan.carpenter; +Cc: sjur.brandeland, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 7 Feb 2012 10:20:15 +0300

> "priv" is initialized twice.  I kept the second one, because it is next
> to the check for NULL.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks Dan.

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

end of thread, other threads:[~2012-02-07 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-07  7:20 [patch] caif: remove duplicate initialization Dan Carpenter
2012-02-07 18:39 ` David Miller

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).