* [linux-next:master 9546/11394] drivers/mtd/ubi/nvmem.c:34:16: sparse: sparse: incompatible types in comparison expression (different type sizes):
@ 2024-03-02 0:51 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-03-02 0:51 UTC (permalink / raw)
To: Daniel Golle
Cc: oe-kbuild-all, Linux Memory Management List, Richard Weinberger
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 1870cdc0e8dee32e3c221704a2977898ba4c10e8
commit: 3ce485803da1b79b2692b6d0c2792829292ad838 [9546/11394] mtd: ubi: provide NVMEM layer over UBI volumes
config: mips-randconfig-r113-20240302 (https://download.01.org/0day-ci/archive/20240302/202403020803.FQFeCxpT-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 325f51237252e6dab8e4e1ea1fa7acbb4faee1cd)
reproduce: (https://download.01.org/0day-ci/archive/20240302/202403020803.FQFeCxpT-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/202403020803.FQFeCxpT-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/mtd/ubi/nvmem.c:34:16: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/mtd/ubi/nvmem.c:34:16: sparse: int *
drivers/mtd/ubi/nvmem.c:34:16: sparse: unsigned long long [usertype] *
drivers/mtd/ubi/nvmem.c:34:16: sparse: sparse: shift too big (32) for type int
drivers/mtd/ubi/nvmem.c: note: in included file (through drivers/mtd/ubi/ubi.h):
include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
vim +34 drivers/mtd/ubi/nvmem.c
22
23 static int ubi_nvmem_reg_read(void *priv, unsigned int from,
24 void *val, size_t bytes)
25 {
26 int err = 0, lnum = from, offs, bytes_left = bytes, to_read;
27 struct ubi_nvmem *unv = priv;
28 struct ubi_volume_desc *desc;
29
30 desc = ubi_open_volume(unv->ubi_num, unv->vol_id, UBI_READONLY);
31 if (IS_ERR(desc))
32 return PTR_ERR(desc);
33
> 34 offs = do_div(lnum, unv->usable_leb_size);
35 while (bytes_left) {
36 to_read = unv->usable_leb_size - offs;
37
38 if (to_read > bytes_left)
39 to_read = bytes_left;
40
41 err = ubi_read(desc, lnum, val, offs, to_read);
42 if (err)
43 break;
44
45 lnum += 1;
46 offs = 0;
47 bytes_left -= to_read;
48 val += to_read;
49 }
50 ubi_close_volume(desc);
51
52 if (err)
53 return err;
54
55 return bytes_left == 0 ? 0 : -EIO;
56 }
57
--
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-03-02 0:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-02 0:51 [linux-next:master 9546/11394] drivers/mtd/ubi/nvmem.c:34:16: sparse: sparse: incompatible types in comparison expression (different type sizes): 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