[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210191553.vO9rtKe5-lkp@intel.com>
Date: Wed, 19 Oct 2022 15:46:42 +0800
From: kernel test robot <lkp@...el.com>
To: Tomislav Požega <pozega.tomislav@...il.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org, Kalle Valo <kvalo@...nel.org>,
Daniel Golle <daniel@...rotopia.org>
Subject: drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9439:15: warning:
result of comparison of constant -7 with expression of type 'char' is always
false
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 <lkp@...el.com>
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.
vim +/char +9439 drivers/net/wireless/ralink/rt2x00/rt2800lib.c
9350
9351 static void rt2800_iq_search(struct rt2x00_dev *rt2x00dev, u8 ch_idx, u8 *ges, u8 *pes)
9352 {
9353 u32 p0 = 0, p1 = 0, pf = 0;
9354 char perr = 0, gerr = 0, iq_err = 0;
9355 char pef = 0, gef = 0;
9356 char psta, pend;
9357 char gsta, gend;
9358
9359 u8 ibit = 0x20;
9360 u8 first_search = 0x00, touch_neg_max = 0x00;
9361 char idx0 = 0, idx1 = 0;
9362 u8 gop;
9363 u8 bbp = 0;
9364 char bidx;
9365
9366 for (bidx = 5; bidx >= 1; bidx--) {
9367 for (gop = 0; gop < 2; gop++) {
9368 if (gop == 1 || bidx < 4) {
9369 if (gop == 0)
9370 iq_err = gerr;
9371 else
9372 iq_err = perr;
9373
9374 first_search = (gop == 0) ? (bidx == 3) : (bidx == 5);
9375 touch_neg_max = (gop) ? ((iq_err & 0x0F) == 0x08) :
9376 ((iq_err & 0x3F) == 0x20);
9377
9378 if (touch_neg_max) {
9379 p0 = pf;
9380 idx0 = iq_err;
9381 } else {
9382 idx0 = iq_err - ibit;
9383 bbp = (ch_idx == 0) ? ((gop == 0) ? 0x28 : 0x29) :
9384 ((gop == 0) ? 0x46 : 0x47);
9385
9386 rt2800_bbp_write(rt2x00dev, 158, bbp);
9387 rt2800_bbp_write(rt2x00dev, 159, idx0);
9388
9389 p0 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
9390 }
9391
9392 idx1 = iq_err + (first_search ? 0 : ibit);
9393 idx1 = (gop == 0) ? (idx1 & 0x0F) : (idx1 & 0x3F);
9394
9395 bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 :
9396 (gop == 0) ? 0x46 : 0x47;
9397
9398 rt2800_bbp_write(rt2x00dev, 158, bbp);
9399 rt2800_bbp_write(rt2x00dev, 159, idx1);
9400
9401 p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
9402
9403 rt2x00_dbg(rt2x00dev,
9404 "p0=%x, p1=%x, pwer_final=%x, idx0=%x, idx1=%x, iq_err=%x, gop=%d, ibit=%x\n",
9405 p0, p1, pf, idx0, idx1, iq_err, gop, ibit);
9406
9407 if (!(!first_search && pf <= p0 && pf < p1)) {
9408 if (p0 < p1) {
9409 pf = p0;
9410 iq_err = idx0;
9411 } else {
9412 pf = p1;
9413 iq_err = idx1;
9414 }
9415 }
9416
9417 bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 :
9418 (gop == 0) ? 0x46 : 0x47;
9419
9420 rt2800_bbp_write(rt2x00dev, 158, bbp);
9421 rt2800_bbp_write(rt2x00dev, 159, iq_err);
9422
9423 if (gop == 0)
9424 gerr = iq_err;
9425 else
9426 perr = iq_err;
9427
9428 rt2x00_dbg(rt2x00dev, "IQCalibration pf=%8x (%2x, %2x) !\n",
9429 pf, gerr & 0x0F, perr & 0x3F);
9430 }
9431 }
9432
9433 if (bidx > 0)
9434 ibit = (ibit >> 1);
9435 }
9436 gerr = (gerr & 0x08) ? (gerr & 0x0F) - 0x10 : (gerr & 0x0F);
9437 perr = (perr & 0x20) ? (perr & 0x3F) - 0x40 : (perr & 0x3F);
9438
> 9439 gerr = (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 : gerr;
9440 gsta = gerr - 1;
9441 gend = gerr + 2;
9442
9443 perr = (perr < -0x1f) ? -0x1f : (perr > 0x1d) ? 0x1d : perr;
9444 psta = perr - 1;
9445 pend = perr + 2;
9446
9447 for (gef = gsta; gef <= gend; gef = gef + 1)
9448 for (pef = psta; pef <= pend; pef = pef + 1) {
9449 bbp = (ch_idx == 0) ? 0x28 : 0x46;
9450 rt2800_bbp_write(rt2x00dev, 158, bbp);
9451 rt2800_bbp_write(rt2x00dev, 159, gef & 0x0F);
9452
9453 bbp = (ch_idx == 0) ? 0x29 : 0x47;
9454 rt2800_bbp_write(rt2x00dev, 158, bbp);
9455 rt2800_bbp_write(rt2x00dev, 159, pef & 0x3F);
9456
9457 p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
9458 if (gef == gsta && pef == psta) {
9459 pf = p1;
9460 gerr = gef;
9461 perr = pef;
9462 } else if (pf > p1) {
9463 pf = p1;
9464 gerr = gef;
9465 perr = pef;
9466 }
9467 rt2x00_dbg(rt2x00dev, "Fine IQCalibration p1=%8x pf=%8x (%2x, %2x) !\n",
9468 p1, pf, gef & 0x0F, pef & 0x3F);
9469 }
9470
9471 ges[ch_idx] = gerr & 0x0F;
9472 pes[ch_idx] = perr & 0x3F;
9473 }
9474
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (350109 bytes)
Powered by blists - more mailing lists