mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: natechancellor@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	clang-built-linux@googlegroups.com, ndesaulniers@google.com
Subject: Re: [PATCH] net: ethernet: sun: Zero initialize class in default case in niu_add_ethtool_tcam_entry
Date: Fri, 08 Mar 2019 15:26:43 -0800 (PST)	[thread overview]
Message-ID: <20190308.152643.1974199265649566047.davem@davemloft.net> (raw)
In-Reply-To: <20190307232933.10145-1-natechancellor@gmail.com>

From: Nathan Chancellor <natechancellor@gmail.com>
Date: Thu,  7 Mar 2019 16:29:33 -0700

> When building with -Wsometimes-uninitialized, Clang warns:
> 
> drivers/net/ethernet/sun/niu.c:7466:5: warning: variable 'class' is used
> uninitialized whenever switch default is taken
> [-Wsometimes-uninitialized]
> 
> The default case can never happen because i can only be 0 to 3
> (NIU_L3_PROG_CLS is defined as 4). To make this clear to Clang,
> just zero initialize class in the default case (use the macro
> CLASS_CODE_UNRECOG to make it clear this shouldn't happen).
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/403
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Applied, thanks.

      parent reply	other threads:[~2019-03-08 23:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 23:29 Nathan Chancellor
2019-03-08  0:13 ` Nick Desaulniers
2019-03-08 23:26 ` 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=20190308.152643.1974199265649566047.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --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®