linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Maloy <jon.maloy@ericsson.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	Ying Xue <ying.xue@windriver.com>,
	"David S. Miller" <davem@davemloft.net>,
	"tipc-discussion@lists.sourceforge.net" 
	<tipc-discussion@lists.sourceforge.net>,
	Networking <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"clang-built-linux@googlegroups.com" 
	<clang-built-linux@googlegroups.com>
Subject: RE: -Wsometimes-uninitialized Clang warning in net/tipc/node.c
Date: Thu, 21 Mar 2019 19:49:55 +0000	[thread overview]
Message-ID: <BL0PR1501MB200350D36DD72F151218894D9A420@BL0PR1501MB2003.namprd15.prod.outlook.com> (raw)
In-Reply-To: <CAK8P3a0z9sPihaCWwzJ7iEkD-tmU62=yPpHuLFH=dmkJ30Sysg@mail.gmail.com>



> -----Original Message-----
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org>
> On Behalf Of Arnd Bergmann
> Sent: 21-Mar-19 19:23
> To: Jon Maloy <jon.maloy@ericsson.com>
> Cc: Nick Desaulniers <ndesaulniers@google.com>; Nathan Chancellor
> <natechancellor@gmail.com>; Ying Xue <ying.xue@windriver.com>; David S.
> Miller <davem@davemloft.net>; tipc-discussion@lists.sourceforge.net;
> Networking <netdev@vger.kernel.org>; LKML <linux-
> kernel@vger.kernel.org>; clang-built-linux@googlegroups.com
> Subject: Re: -Wsometimes-uninitialized Clang warning in net/tipc/node.c
> 
> On Thu, Mar 21, 2019 at 4:25 PM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > On Thu, Mar 21, 2019 at 3:57 PM Jon Maloy <jon.maloy@ericsson.com>
> wrote:
> 
> > > >
> > > > diff --git a/net/tipc/node.c b/net/tipc/node.c index
> > > > 2dc4919ab23c..147786795e48 100644
> > > > --- a/net/tipc/node.c
> > > > +++ b/net/tipc/node.c
> > > > @@ -844,7 +844,8 @@ static void tipc_node_link_down(struct
> > > > tipc_node *n, int bearer_id, bool delete)
> > > >         tipc_node_write_unlock(n);
> > > >         if (delete)
> > > >                 tipc_mon_remove_peer(n->net, n->addr, old_bearer_id);
> > > > -       tipc_bearer_xmit(n->net, bearer_id, &xmitq, maddr);
> > > > +       if (skb_queue_empty(xmitq))
> > > > +               tipc_bearer_xmit(n->net, bearer_id, &xmitq,
> > > > + maddr);
> > > >         tipc_sk_rcv(n->net, &le->inputq);  }
> > > >
> > > > This duplicates the check inside of skb_queue_empty(), but I don't
> > > > know if the compiler can see through the logic behind the inlined
> function calls.
> > >
> > > Probably not, but this is not in any way time critical.
> >
> > I meant it's unclear whether compilers should be expected to see that
> > skb_queue_empty() is true after the call to __skb_queue_head_init()
> > initializes it.
> 
> I reproduced the warning now, and verified that my change eliminates the
> warning. I still think that is the more logical solution here.

Ok.  No problems with that.

///jon

> 
>       Arnd

      reply	other threads:[~2019-03-21 19:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08  0:17 -Wsometimes-uninitialized Clang warning in net/tipc/node.c Nathan Chancellor
2019-03-20 19:07 ` Nathan Chancellor
2019-03-20 20:50   ` Nick Desaulniers
2019-03-21 11:45     ` Arnd Bergmann
2019-03-21 14:57       ` Jon Maloy
2019-03-21 15:25         ` Arnd Bergmann
2019-03-21 18:22           ` Arnd Bergmann
2019-03-21 19:49             ` Jon Maloy [this message]

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=BL0PR1501MB200350D36DD72F151218894D9A420@BL0PR1501MB2003.namprd15.prod.outlook.com \
    --to=jon.maloy@ericsson.com \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.com \
    /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).