mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: arnd@arndb.de
Cc: jiri@resnulli.us, idosch@mellanox.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rocker: fix Wmaybe-uninitialized false-positive
Date: Tue, 28 Mar 2017 21:42:58 -0700 (PDT)	[thread overview]
Message-ID: <20170328.214258.1096589839586809714.davem@davemloft.net> (raw)
In-Reply-To: <20170328141126.1541994-1-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 28 Mar 2017 16:11:18 +0200

> gcc-7 reports a warning that earlier versions did not have:
> 
> drivers/net/ethernet/rocker/rocker_ofdpa.c: In function 'ofdpa_port_stp_update':
> arch/x86/include/asm/string_32.h:79:22: error: '*((void *)&prev_ctrls+4)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    *((short *)to + 2) = *((short *)from + 2);
>    ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/rocker/rocker_ofdpa.c:2218:7: note: '*((void *)&prev_ctrls+4)' was declared here
> 
> This is clearly a variation of the warning about 'prev_state' that
> was shut up using uninitialized_var().
> 
> We can slightly simplify the code and get rid of the warning by unconditionally
> saving the prev_state and prev_ctrls variables. The inlined memcpy is not
> particularly expensive here, as it just has to read five bytes from one or
> two cache lines.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thank you.

      reply	other threads:[~2017-03-29  4:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 14:11 Arnd Bergmann
2017-03-29  4:42 ` David Miller [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=20170328.214258.1096589839586809714.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=arnd@arndb.de \
    --cc=idosch@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®