tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b0523c7b1c9d0edcd6c0fe6d2cb558a9ad5c60a8
commit: d7904619ea0636411f40fb1f34057288c0783ecf [11495/12912] mtd: rawnand: Add
nand_extract_bits()
config: arc-randconfig-r031-20200526 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
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
git checkout d7904619ea0636411f40fb1f34057288c0783ecf
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/bits.h:23,
from arch/arc/plat-eznps/include/plat/ctop.h:13,
from arch/arc/include/asm/barrier.h:42,
from include/linux/compiler.h:256,
from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/mtd/nand/raw/nand_base.c:28:
drivers/mtd/nand/raw/nand_base.c: In function 'nand_extract_bits':
include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always
false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
> drivers/mtd/nand/raw/nand_base.c:300:29: note: in expansion of
macro 'GENMASK'
300 | tmp = (*src >> src_off) & GENMASK(n - 1,
0);
| ^~~~~~~
include/linux/bits.h:26:40: warning: comparison of unsigned expression < 0 is always
false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
> drivers/mtd/nand/raw/nand_base.c:300:29: note: in expansion of
macro 'GENMASK'
300 | tmp = (*src >> src_off) & GENMASK(n - 1,
0);
| ^~~~~~~
vim +/GENMASK +300 drivers/mtd/nand/raw/nand_base.c
276
277 /**
278 * nand_extract_bits - Copy unaligned bits from one buffer to another one
279 * @dst: destination buffer
280 * @dst_off: bit offset at which the writing starts
281 * @src: source buffer
282 * @src_off: bit offset at which the reading starts
283 * @nbits: number of bits to copy from @src to @dst
284 *
285 * Copy bits from one memory region to another (overlap authorized).
286 */
287 void nand_extract_bits(u8 *dst, unsigned int dst_off, const u8 *src,
288 unsigned int src_off, unsigned int nbits)
289 {
290 unsigned int tmp, n;
291
292 dst += dst_off / 8;
293 dst_off %= 8;
294 src += src_off / 8;
295 src_off %= 8;
296
297 while (nbits) {
298 n = min3(8 - dst_off, 8 - src_off, nbits);
299
300 tmp = (*src >> src_off) & GENMASK(n - 1, 0);
301 *dst &= ~GENMASK(n - 1 + dst_off, dst_off);
302 *dst |= tmp << dst_off;
303
304 dst_off += n;
305 if (dst_off >= 8) {
306 dst++;
307 dst_off -= 8;
308 }
309
310 src_off += n;
311 if (src_off >= 8) {
312 src++;
313 src_off -= 8;
314 }
315
316 nbits -= n;
317 }
318 }
319 EXPORT_SYMBOL_GPL(nand_extract_bits);
320
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org