tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: be978f8feb1d4678b941a3ccf181eea1039110e2
commit: 4a08c5ce7fc2bddf10b7701be167b0fb00845f19 [7073/7824] exfat: fix name_hash
computation on big endian systems
config: x86_64-randconfig-s022-20200713 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-37-gc9676a3b-dirty
git checkout 4a08c5ce7fc2bddf10b7701be167b0fb00845f19
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> fs/exfat/nls.c:522:27: sparse: sparse: incorrect type in
assignment (different base types) @@ expected unsigned short @@ got restricted
__le16 [usertype] @@
> fs/exfat/nls.c:522:27: sparse: expected unsigned short
> fs/exfat/nls.c:522:27: sparse: got restricted __le16 [usertype]
fs/exfat/nls.c:614:32: sparse: sparse: incorrect type in assignment (different base types)
@@ expected unsigned short @@ got restricted __le16 [usertype] @@
fs/exfat/nls.c:614:32: sparse: expected unsigned short
fs/exfat/nls.c:614:32: sparse: got restricted __le16 [usertype]
vim +522 fs/exfat/nls.c
492
493 static int exfat_utf8_to_utf16(struct super_block *sb,
494 const unsigned char *p_cstring, const int len,
495 struct exfat_uni_name *p_uniname, int *p_lossy)
496 {
497 int i, unilen, lossy = NLS_NAME_NO_LOSSY;
498 unsigned short upname[MAX_NAME_LENGTH + 1];
499 unsigned short *uniname = p_uniname->name;
500
501 WARN_ON(!len);
502
503 unilen = utf8s_to_utf16s(p_cstring, len, UTF16_HOST_ENDIAN,
504 (wchar_t *)uniname, MAX_NAME_LENGTH + 2);
505 if (unilen < 0) {
506 exfat_err(sb, "failed to %s (err : %d) nls len : %d",
507 __func__, unilen, len);
508 return unilen;
509 }
510
511 if (unilen > MAX_NAME_LENGTH) {
512 exfat_err(sb, "failed to %s (estr:ENAMETOOLONG) nls len : %d, unilen : %d
> %d",
513 __func__, len, unilen, MAX_NAME_LENGTH);
514 return -ENAMETOOLONG;
515 }
516
517 for (i = 0; i < unilen; i++) {
518 if (*uniname < 0x0020 ||
519 exfat_wstrchr(bad_uni_chars, *uniname))
520 lossy |= NLS_NAME_LOSSY;
521
522 upname[i] = cpu_to_le16(exfat_toupper(sb, *uniname));
523 uniname++;
524 }
525
526 *uniname = '\0';
527 p_uniname->name_len = unilen;
528 p_uniname->name_hash = exfat_calc_chksum16(upname, unilen << 1, 0,
529 CS_DEFAULT);
530
531 if (p_lossy)
532 *p_lossy = lossy;
533 return unilen;
534 }
535
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org