llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [broonie-ci:filekCZcLQ 7/13] sound/soc/codecs/rt1320-sdw.c:564:14: warning: result of comparison of constant 4295491583 with expression of type 'unsigned int' is always false
@ 2024-10-01  3:05 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-01  3:05 UTC (permalink / raw)
  To: Shuming Fan; +Cc: llvm, oe-kbuild-all, Mark Brown

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ci.git filekCZcLQ
head:   4649cbd97fdae5069e9a71cd7669b62b90e03669
commit: d72498fad93abf1817c4998d172a3d7f98f76bbe [7/13] ASoC: rt1320: reads patch code from firmware file
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241001/202410011159.InLKFd40-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241001/202410011159.InLKFd40-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410011159.InLKFd40-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/soc/codecs/rt1320-sdw.c:564:14: warning: result of comparison of constant 4295491583 with expression of type 'unsigned int' is always false [-Wtautological-constant-out-of-range-compare]
     564 |                                 if (addr > 0x10007ffff || addr < 0x10007000) {
         |                                     ~~~~ ^ ~~~~~~~~~~~
   1 warning generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for MODVERSIONS
   Depends on [n]: MODULES [=y] && !COMPILE_TEST [=y]
   Selected by [y]:
   - RANDSTRUCT_FULL [=y] && (CC_HAS_RANDSTRUCT [=y] || GCC_PLUGINS [=n]) && MODULES [=y]


vim +564 sound/soc/codecs/rt1320-sdw.c

   527	
   528	/*
   529	 * The 'patch code' is written to the patch code area.
   530	 * The patch code area is used for SDCA register expansion flexibility.
   531	 */
   532	static void rt1320_load_mcu_patch(struct rt1320_sdw_priv *rt1320)
   533	{
   534		struct sdw_slave *slave = rt1320->sdw_slave;
   535		const struct firmware *patch;
   536		const char *filename;
   537		unsigned int addr, val;
   538		const unsigned char *ptr;
   539		int ret, i;
   540	
   541		if (rt1320->version_id <= RT1320_VB)
   542			filename = RT1320_VAB_MCU_PATCH;
   543		else
   544			filename = RT1320_VC_MCU_PATCH;
   545	
   546		/* load the patch code here */
   547		ret = request_firmware(&patch, filename, &slave->dev);
   548		if (ret) {
   549			dev_err(&slave->dev, "%s: Failed to load %s firmware", __func__, filename);
   550			regmap_write(rt1320->regmap, 0xc598, 0x00);
   551			regmap_write(rt1320->regmap, 0x10007000, 0x67);
   552			regmap_write(rt1320->regmap, 0x10007001, 0x80);
   553			regmap_write(rt1320->regmap, 0x10007002, 0x00);
   554			regmap_write(rt1320->regmap, 0x10007003, 0x00);
   555		} else {
   556			ptr = (const unsigned char *)patch->data;
   557			if ((patch->size % 8) == 0) {
   558				for (i = 0; i < patch->size; i += 8) {
   559					addr = (ptr[i] & 0xff) | (ptr[i + 1] & 0xff) << 8 |
   560						(ptr[i + 2] & 0xff) << 16 | (ptr[i + 3] & 0xff) << 24;
   561					val = (ptr[i + 4] & 0xff) | (ptr[i + 5] & 0xff) << 8 |
   562						(ptr[i + 6] & 0xff) << 16 | (ptr[i + 7] & 0xff) << 24;
   563	
 > 564					if (addr > 0x10007ffff || addr < 0x10007000) {
   565						dev_err(&slave->dev, "%s: the address 0x%x is wrong", __func__, addr);
   566						goto _exit_;
   567					}
   568					if (val > 0xff) {
   569						dev_err(&slave->dev, "%s: the value 0x%x is wrong", __func__, val);
   570						goto _exit_;
   571					}
   572					regmap_write(rt1320->regmap, addr, val);
   573				}
   574			}
   575	_exit_:
   576			release_firmware(patch);
   577		}
   578	}
   579	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-01  3:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01  3:05 [broonie-ci:filekCZcLQ 7/13] sound/soc/codecs/rt1320-sdw.c:564:14: warning: result of comparison of constant 4295491583 with expression of type 'unsigned int' is always false kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).