public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Nathan Chancellor <nathan@kernel.org>
Cc: kernel test robot <lkp@intel.com>, Marek Vasut <marex@denx.de>,
	kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	linux-kernel@vger.kernel.org
Subject: Re: drivers/net/ethernet/micrel/ks8851_common.c:995:6: warning: variable 'ret' set but not used
Date: Thu, 3 Jun 2021 01:29:18 +0200	[thread overview]
Message-ID: <YLgUTnam/rp2ltaU@lunn.ch> (raw)
In-Reply-To: <b34e07af-4559-7707-b00b-5a36789e566d@kernel.org>

On Wed, Jun 02, 2021 at 01:02:43PM -0700, Nathan Chancellor wrote:
> On 6/2/2021 12:32 PM, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   231bc539066760aaa44d46818c85b14ca2f56d9f
> > commit: 797047f875b5463719cc70ba213eb691d453c946 net: ks8851: Implement Parallel bus operations
> > date:   1 year ago
> > config: x86_64-randconfig-a004-20210601 (attached as .config)
> > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d41cb6bb2607fa5c7a9df2b3dab361353657d225)
> > reproduce (this is a W=1 build):
> >          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >          chmod +x ~/bin/make.cross
> >          # install x86_64 cross compiling tool for clang build
> >          # apt-get install binutils-x86-64-linux-gnu
> >          # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=797047f875b5463719cc70ba213eb691d453c946
> >          git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> >          git fetch --no-tags linus master
> >          git checkout 797047f875b5463719cc70ba213eb691d453c946
> >          # save the attached .config to linux build tree
> >          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
> > 
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> > 
> > All warnings (new ones prefixed by >>):
> > 
> > > > drivers/net/ethernet/micrel/ks8851_common.c:995:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
> >             int ret = 0;
> >                 ^
> >     1 warning generated.
> 
> This warning is newly implemented in clang, it was not caused by the above
> commit. As you can see from the blame below, this has been an issue since
> this driver's introduction. I wonder if it was intended to return ret in the
> places that return 0?

The return value from s8851_read_selftest() is ignored by the
caller. Probably ret could be removed and the function made to return
void.

	Andrew

      reply	other threads:[~2021-06-02 23:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 19:32 drivers/net/ethernet/micrel/ks8851_common.c:995:6: warning: variable 'ret' set but not used kernel test robot
2021-06-02 20:02 ` Nathan Chancellor
2021-06-02 23:29   ` Andrew Lunn [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=YLgUTnam/rp2ltaU@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=marex@denx.de \
    --cc=nathan@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