netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Haley <brian.haley@hp.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] netlink: silence compiler warning
Date: Fri, 04 Sep 2009 21:36:06 -0400	[thread overview]
Message-ID: <4AA1C086.5000607@hp.com> (raw)
In-Reply-To: <1252112881.27694.3.camel@violet>

Hi Marcel,

Marcel Holtmann wrote:
> can we please add the err = -E... where it actually is needed and not
> stupidly go ahead and silence compiler warnings with err = 0. This has
> been posted before.

Sorry, I don't remember it being posted before.  If you look at the code
though, err is correctly initialized, gcc just can't figure it out.  The
choices I see are either what I originally posted, using uninitialized_var(err),
or the patch below.  It doesn't matter to me.

-Brian


diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 66f6ba0..8741036 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -177,6 +177,7 @@ int genl_register_mc_group(struct genl_family *family,
 		struct net *net;
 
 		rcu_read_lock();
+		err = 0;
 		for_each_net_rcu(net) {
 			err = netlink_change_ngroups(net->genl_sock,
 					mc_groups_longs * BITS_PER_LONG);

  reply	other threads:[~2009-09-05  1:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-05  0:55 [PATCH] netlink: silence compiler warning Brian Haley
2009-09-05  1:08 ` Marcel Holtmann
2009-09-05  1:36   ` Brian Haley [this message]
2009-09-05  3:33     ` David Miller
2009-09-05  7:52       ` Jarek Poplawski
2009-09-05  8:13         ` David Miller
2009-09-05  3:32   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AA1C086.5000607@hp.com \
    --to=brian.haley@hp.com \
    --cc=davem@davemloft.net \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).