[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YLgUTnam/rp2ltaU@lunn.ch>
Date: Thu, 3 Jun 2021 01:29:18 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Nathan Chancellor <nathan@...nel.org>
Cc: kernel test robot <lkp@...el.com>, Marek Vasut <marex@...x.de>,
kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
linux-kernel@...r.kernel.org
Subject: Re: drivers/net/ethernet/micrel/ks8851_common.c:995:6: warning:
variable 'ret' set but not used
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@...el.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
Powered by blists - more mailing lists