From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE9E117C4 for ; Thu, 20 Oct 2022 05:26:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D077FC433C1; Thu, 20 Oct 2022 05:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666243607; bh=vAZmXggjSCZpIcGU5wkrL2Ub6Nof/q/Qn9/o5p8l1ZA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=acXmbVM7o1Fp6FBk33RSXnCufre5ha3eZfjfq9gJOhnuGQF6qB9oWHBgvT1HZZZcq byGruFKcw4Sx7fe2rhjxmuBhB0Ejy7L4aB2d0LtarcwWWIhiPA6dBcv7lB31Mq6G/u tozJjODOQ0RK1pdsnTn/EtV1DLJMd4/iovNgv4eDR4MQJ2JJlo7B61/lyno7xoWdgL upC5qjiUJ4PQCOpI/GWCgpY9mqk3o1jAUfeKcAUY4TmoRrI0ox1OpHzsiLBxqmpmuw PPzoiJG+IAvPVLVNqnzSxEQp+hzjolIJPM9ASHK4I9WvJM/yrwOXTsySLA9f7J4IMY VnGZLLULxjrlA== From: Kalle Valo To: "Jason A. Donenfeld" Cc: kernel test robot , Tomislav =?utf-8?Q?Po=C5=BEega?= , llvm@lists.linux.dev, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Daniel Golle , linux-wireless@vger.kernel.org Subject: Re: drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9439:15: warning: result of comparison of constant -7 with expression of type 'char' is always false References: <202210191553.vO9rtKe5-lkp@intel.com> <87pmeol020.fsf@kernel.org> Date: Thu, 20 Oct 2022 08:26:40 +0300 In-Reply-To: (Jason A. Donenfeld's message of "Wed, 19 Oct 2022 02:15:33 -0600") Message-ID: <87lepb2hgv.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Jason A. Donenfeld" writes: > On Wed, Oct 19, 2022 at 2:02 AM Jason A. Donenfeld wrote: >> >> On Wed, Oct 19, 2022 at 1:59 AM Jason A. Donenfeld wrote: >> > >> > On Wed, Oct 19, 2022 at 1:55 AM Kalle Valo wrote: >> > > >> > > + jason, linux-wireless >> > > >> > > kernel test robot writes: >> > > >> > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >> > > > head: aae703b02f92bde9264366c545e87cec451de471 >> > > > commit: dab902fe1d29dc0fa1dccc8d13dc89ffbf633881 wifi: rt2x00: add TX >> > > > LOFT calibration for MT7620 >> > > > date: 4 weeks ago >> > > > config: arm64-allmodconfig >> > > > compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project >> > > > 791a7ae1ba3efd6bca96338e10ffde557ba83920) >> > > > 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 arm64 cross compiling tool for clang build >> > > > # apt-get install binutils-aarch64-linux-gnu >> > > > # >> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dab902fe1d29dc0fa1dccc8d13dc89ffbf633881 >> > > > git remote add linus >> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git >> > > > git fetch --no-tags linus master >> > > > git checkout dab902fe1d29dc0fa1dccc8d13dc89ffbf633881 >> > > > # save the config file >> > > > mkdir build_dir && cp config build_dir/.config >> > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 >> > > > O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/amd/amdgpu/ >> > > > drivers/net/wireless/ralink/rt2x00/ drivers/staging/media/ >> > > > >> > > > If you fix the issue, kindly add following tag where applicable >> > > > | Reported-by: kernel test robot >> > > > >> > > > All warnings (new ones prefixed by >>): >> > > > >> > > >>> drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9439:15: warning: >> > > >> result of comparison of constant -7 with expression of type 'char' >> > > >> is always false [-Wtautological-constant-out-of-range-compare] >> > > > gerr = (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 : gerr; >> > > > ~~~~ ^ ~~~~~ >> > > > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9443:15: warning: result of comparison of constant -31 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] >> > > > perr = (perr < -0x1f) ? -0x1f : (perr > 0x1d) ? 0x1d : perr; >> > > > ~~~~ ^ ~~~~~ >> > > > 2 warnings generated. >> > > >> > > I believe this patch should fix it: >> > > >> > > https://patchwork.kernel.org/project/linux-wireless/patch/20221018202734.140489-1-Jason@zx2c4.com/ >> > > >> > > Jason, is my understanding correct? >> > >> > That's a different bug caused by the same pitfall: assuming char is >> > signed. I'll send a patch for that function too. >> >> >> Actually, maybe I should fix the whole file? Patch incoming. > > Okay here's a v2 that handles it driver-wide: > https://lore.kernel.org/linux-wireless/20221019081417.3402284-1-Jason@zx2c4.com/ > (Might take a few minutes to hit lore.) Great, thanks Jason. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5455445811903980261==" MIME-Version: 1.0 From: Kalle Valo To: kbuild-all@lists.01.org Subject: Re: drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9439:15: warning: result of comparison of constant -7 with expression of type 'char' is always false Date: Thu, 20 Oct 2022 08:26:40 +0300 Message-ID: <87lepb2hgv.fsf@kernel.org> In-Reply-To: List-Id: --===============5455445811903980261== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable "Jason A. Donenfeld" writes: > On Wed, Oct 19, 2022 at 2:02 AM Jason A. Donenfeld wr= ote: >> >> On Wed, Oct 19, 2022 at 1:59 AM Jason A. Donenfeld w= rote: >> > >> > On Wed, Oct 19, 2022 at 1:55 AM Kalle Valo wrote: >> > > >> > > + jason, linux-wireless >> > > >> > > kernel test robot writes: >> > > >> > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/l= inux.git master >> > > > head: aae703b02f92bde9264366c545e87cec451de471 >> > > > commit: dab902fe1d29dc0fa1dccc8d13dc89ffbf633881 wifi: rt2x00: add= TX >> > > > LOFT calibration for MT7620 >> > > > date: 4 weeks ago >> > > > config: arm64-allmodconfig >> > > > compiler: clang version 16.0.0 (https://github.com/llvm/llvm-proje= ct >> > > > 791a7ae1ba3efd6bca96338e10ffde557ba83920) >> > > > 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 arm64 cross compiling tool for clang build >> > > > # apt-get install binutils-aarch64-linux-gnu >> > > > # >> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= /commit/?id=3Ddab902fe1d29dc0fa1dccc8d13dc89ffbf633881 >> > > > git remote add linus >> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git >> > > > git fetch --no-tags linus master >> > > > git checkout dab902fe1d29dc0fa1dccc8d13dc89ffbf633881 >> > > > # save the config file >> > > > mkdir build_dir && cp config build_dir/.config >> > > > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.c= ross W=3D1 >> > > > O=3Dbuild_dir ARCH=3Darm64 SHELL=3D/bin/bash drivers/gpu/drm/amd/a= mdgpu/ >> > > > drivers/net/wireless/ralink/rt2x00/ drivers/staging/media/ >> > > > >> > > > If you fix the issue, kindly add following tag where applicable >> > > > | Reported-by: kernel test robot >> > > > >> > > > All warnings (new ones prefixed by >>): >> > > > >> > > >>> drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9439:15: warning: >> > > >> result of comparison of constant -7 with expression of type 'char' >> > > >> is always false [-Wtautological-constant-out-of-range-compare] >> > > > gerr =3D (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 = : gerr; >> > > > ~~~~ ^ ~~~~~ >> > > > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9443:15: warning= : result of comparison of constant -31 with expression of type 'char' is al= ways false [-Wtautological-constant-out-of-range-compare] >> > > > perr =3D (perr < -0x1f) ? -0x1f : (perr > 0x1d) ? 0x1d = : perr; >> > > > ~~~~ ^ ~~~~~ >> > > > 2 warnings generated. >> > > >> > > I believe this patch should fix it: >> > > >> > > https://patchwork.kernel.org/project/linux-wireless/patch/2022101820= 2734.140489-1-Jason(a)zx2c4.com/ >> > > >> > > Jason, is my understanding correct? >> > >> > That's a different bug caused by the same pitfall: assuming char is >> > signed. I'll send a patch for that function too. >> >> >> Actually, maybe I should fix the whole file? Patch incoming. > > Okay here's a v2 that handles it driver-wide: > https://lore.kernel.org/linux-wireless/20221019081417.3402284-1-Jason(a)z= x2c4.com/ > (Might take a few minutes to hit lore.) Great, thanks Jason. -- = https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatc= hes --===============5455445811903980261==--