From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1880C4708F for ; Wed, 2 Jun 2021 23:29:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7069660FD8 for ; Wed, 2 Jun 2021 23:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbhFBXbU (ORCPT ); Wed, 2 Jun 2021 19:31:20 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:42178 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhFBXbS (ORCPT ); Wed, 2 Jun 2021 19:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=5OxZhY2Lx3PSsgLeIF/CGHfusFZKZ4M8VuvTPJ8fjZk=; b=qPx9Zq7Ez6DFtc8Pc1fk2eNwiN 8cc8XJj7Zz4y1t1yADcuWFIx07QBEdxXAEWwgBSl9Wf+OOA+2LHUy9l817i7GdZHQycvll8eant8k KxrFQ6QrTsj2zhvWgpi07w7ZWvSthQ0UvqVs/+S+QEGCNUpUfeSWffJgYs30vPwm0Vs4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1loaIY-007XKV-Hv; Thu, 03 Jun 2021 01:29:18 +0200 Date: Thu, 3 Jun 2021 01:29:18 +0200 From: Andrew Lunn To: Nathan Chancellor Cc: kernel test robot , Marek Vasut , 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 Message-ID: References: <202106030332.tmiMOCF7-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 > > > > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============9034599210926013686==" MIME-Version: 1.0 From: Andrew Lunn To: kbuild-all@lists.01.org Subject: Re: drivers/net/ethernet/micrel/ks8851_common.c:995:6: warning: variable 'ret' set but not used Date: Thu, 03 Jun 2021 01:29:18 +0200 Message-ID: In-Reply-To: List-Id: --===============9034599210926013686== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 d4= 1cb6bb2607fa5c7a9df2b3dab361353657d225) > > reproduce (this is a W=3D1 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/lin= ux.git/commit/?id=3D797047f875b5463719cc70ba213eb691d453c946 > > git remote add linus https://git.kernel.org/pub/scm/linux/kern= el/git/torvalds/linux.git > > git fetch --no-tags linus master > > git checkout 797047f875b5463719cc70ba213eb691d453c946 > > # save the attached .config to linux build tree > > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross= ARCH=3Dx86_64 > > = > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > = > > All warnings (new ones prefixed by >>): > > = > > > > drivers/net/ethernet/micrel/ks8851_common.c:995:6: warning: variabl= e 'ret' set but not used [-Wunused-but-set-variable] > > int ret =3D 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 --===============9034599210926013686==--