fs/ntfs/runlist.c:1953:47-52: WARNING: conversion to bool not needed here
From: kernel test robot
Date: Thu May 21 2026 - 00:40:57 EST
Hi Namjae,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8bc67e4db64aa72732c474b44ea8622062c903f0
commit: 47503f989736d6c4c9f8bfca1c28d267473ccd4b ntfs: add Kconfig and Makefile
date: 3 months ago
config: um-randconfig-r063-20260521 (https://download.01.org/0day-ci/archive/20260521/202605211248.DSL7pell-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
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
| Fixes: 47503f989736 ("ntfs: add Kconfig and Makefile")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605211248.DSL7pell-lkp@xxxxxxxxx/
cocci warnings: (new ones prefixed by >>)
>> fs/ntfs/runlist.c:1953:47-52: WARNING: conversion to bool not needed here
fs/ntfs/runlist.c:1961:62-67: WARNING: conversion to bool not needed here
fs/ntfs/runlist.c:1964:65-70: WARNING: conversion to bool not needed here
fs/ntfs/runlist.c:1802:47-52: WARNING: conversion to bool not needed here
fs/ntfs/runlist.c:1810:62-67: WARNING: conversion to bool not needed here
fs/ntfs/runlist.c:1813:65-70: WARNING: conversion to bool not needed here
--
>> fs/ntfs/logfile.c:626:2-8: WARNING: NULL check before some freeing functions is not needed.
--
>> fs/ntfs/super.c:2519:2-8: WARNING: NULL check before some freeing functions is not needed.
fs/ntfs/super.c:1731:2-8: WARNING: NULL check before some freeing functions is not needed.
vim +1953 fs/ntfs/runlist.c
11ccc9107dc460 Namjae Jeon 2026-02-13 1928
11ccc9107dc460 Namjae Jeon 2026-02-13 1929 struct runlist_element *ntfs_rl_collapse_range(struct runlist_element *dst_rl, int dst_cnt,
11ccc9107dc460 Namjae Jeon 2026-02-13 1930 s64 start_vcn, s64 len,
11ccc9107dc460 Namjae Jeon 2026-02-13 1931 struct runlist_element **punch_rl,
11ccc9107dc460 Namjae Jeon 2026-02-13 1932 size_t *new_rl_cnt)
11ccc9107dc460 Namjae Jeon 2026-02-13 1933 {
11ccc9107dc460 Namjae Jeon 2026-02-13 1934 struct runlist_element *s_rl, *e_rl, *new_rl, *dst_3rd_rl;
11ccc9107dc460 Namjae Jeon 2026-02-13 1935 s64 end_vcn;
11ccc9107dc460 Namjae Jeon 2026-02-13 1936 int new_1st_cnt, dst_3rd_cnt, new_cnt, punch_cnt, merge_cnt, i;
11ccc9107dc460 Namjae Jeon 2026-02-13 1937 bool begin_split, end_split, one_split_3;
11ccc9107dc460 Namjae Jeon 2026-02-13 1938
11ccc9107dc460 Namjae Jeon 2026-02-13 1939 if (dst_cnt < 2 ||
11ccc9107dc460 Namjae Jeon 2026-02-13 1940 !(dst_rl[dst_cnt - 1].lcn == LCN_ENOENT &&
11ccc9107dc460 Namjae Jeon 2026-02-13 1941 dst_rl[dst_cnt - 1].length == 0))
11ccc9107dc460 Namjae Jeon 2026-02-13 1942 return ERR_PTR(-EINVAL);
11ccc9107dc460 Namjae Jeon 2026-02-13 1943
11ccc9107dc460 Namjae Jeon 2026-02-13 1944 end_vcn = min(start_vcn + len - 1,
11ccc9107dc460 Namjae Jeon 2026-02-13 1945 dst_rl[dst_cnt - 1].vcn - 1);
11ccc9107dc460 Namjae Jeon 2026-02-13 1946
11ccc9107dc460 Namjae Jeon 2026-02-13 1947 s_rl = ntfs_rl_find_vcn_nolock(dst_rl, start_vcn);
11ccc9107dc460 Namjae Jeon 2026-02-13 1948 if (!s_rl ||
11ccc9107dc460 Namjae Jeon 2026-02-13 1949 s_rl->lcn <= LCN_ENOENT ||
11ccc9107dc460 Namjae Jeon 2026-02-13 1950 !ntfs_rle_contain(s_rl, start_vcn))
11ccc9107dc460 Namjae Jeon 2026-02-13 1951 return ERR_PTR(-EINVAL);
11ccc9107dc460 Namjae Jeon 2026-02-13 1952
11ccc9107dc460 Namjae Jeon 2026-02-13 @1953 begin_split = s_rl->vcn != start_vcn ? true : false;
:::::: The code at line 1953 was first introduced by commit
:::::: 11ccc9107dc460de28af90fac1f42404d9802735 ntfs: update runlist handling and cluster allocator
:::::: TO: Namjae Jeon <linkinjeon@xxxxxxxxxx>
:::::: CC: Namjae Jeon <linkinjeon@xxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki