linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [media] dvb: avoid warning in dvb_net
Date: Thu, 27 Oct 2016 10:13:27 -0400	[thread overview]
Message-ID: <20161027141327.GE42084@redhat.com> (raw)
In-Reply-To: <20161027140835.2345937-1-arnd@arndb.de>

On Thu, Oct 27, 2016 at 03:57:41PM +0200, Arnd Bergmann wrote:
> With gcc-5 or higher on x86, we can get a bogus warning in the
> dvb-net code:
> 
> drivers/media/dvb-core/dvb_net.c: In function ‘dvb_net_ule’:
> arch/x86/include/asm/string_32.h:77:14: error: ‘dest_addr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/media/dvb-core/dvb_net.c:633:8: note: ‘dest_addr’ was declared here
> 
> The problem here is that gcc doesn't track all of the conditions
> to prove it can't end up copying uninitialized data.
> This changes the logic around so we zero out the destination
> address earlier when we determine that it is not set here.
> This allows the compiler to figure it out.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/media/dvb-core/dvb_net.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
> index 088914c4623f..f1b416de9dab 100644
> --- a/drivers/media/dvb-core/dvb_net.c
> +++ b/drivers/media/dvb-core/dvb_net.c
> @@ -688,6 +688,9 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
>  							      ETH_ALEN);
>  						skb_pull(priv->ule_skb, ETH_ALEN);
>  					}
> +				} else {
> +					 /* othersie use zero destination address */

I'm assuming you meant "otherwise" there instead of "othersie".

-- 
Jarod Wilson
jarod@redhat.com

  reply	other threads:[~2016-10-27 14:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 13:57 [PATCH] [media] dvb: avoid warning in dvb_net Arnd Bergmann
2016-10-27 14:13 ` Jarod Wilson [this message]
2016-10-27 15:09   ` Arnd Bergmann
2016-10-27 15:25     ` Jarod Wilson

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=20161027141327.GE42084@redhat.com \
    --to=jarod@redhat.com \
    --cc=arnd@arndb.de \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@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).