Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455446

Re: [PATCH] infiniband: shut up a maybe-uninitialized warning

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] infiniband: shut up a maybe-uninitialized warning
Date 2016-08-02 22:20 +0200
Message-ID <s1Okq-10b-7@gated-at.bofh.it> (permalink)
References <rRdFv-7cY-1@gated-at.bofh.it> <s1MBZ-8c3-67@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tuesday, August 2, 2016 1:45:25 PM CEST Doug Ledford wrote:
> On Mon, 2016-07-04 at 17:06 +0200, Arnd Bergmann wrote:
> > The powerpc64 default configuration leads to warnings for the
> > infiniband
> > core code:
> > 
> > infiniband/core/cma.c: In function 'cma_get_net_dev':
> > infiniband/core/cma.c:1242:12: warning:
> > 'src_addr_storage.sin_addr.s_addr' may be used uninitialized in this
> > function [-Wmaybe-uninitialized]
> > 
> > The code looks correct to me, and I don't see the warnings on the
> > other architectures, so this is a dumb change to add an unneeded
> > initialization to the variables in order to shut up the warning.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Link: http://arm-soc.lixom.net/buildlogs/mainline/v4.7-
> > rc6/buildall.powerpc.ppc64_defconfig.log.passed
> 
> I thought about taking this, but I also looked over the code and it
> looks correct to me.  This is a semi-hot path in the connection bring
> up code, so I'm loathe to put in sizeof(struct sockaddr_storage) * 2 of
> needless memory writes.  So, I dropped this patch.  Hopefully, ppc64
> compiler will straighten its warnings out soon.

Ok, no worries. Linus just disabled the warning tree-wide for
all compilers, so it's gone from the autobuilder, and newer gcc
versions (4.9 or higher) should be fine too, even if someone
enables the warning manually or by passing W=1.

Thanks for having a look,

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] infiniband: shut up a maybe-uninitialized warning Doug Ledford <dledford@redhat.com> - 2016-08-02 20:30 +0200
  Re: [PATCH] infiniband: shut up a maybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-08-02 22:20 +0200

csiph-web