CC: [email protected] CC: [email protected] BCC: [email protected] In-Reply-To: <[email protected]> References: <[email protected]> TO: Maxime Ripard <[email protected]> TO: Mike Turquette <[email protected]> TO: Stephen Boyd <[email protected]> TO: [email protected] CC: Naresh Kamboju <[email protected]> CC: Alexander Stein <[email protected]> CC: Jerome Brunet <[email protected]> CC: Dmitry Baryshkov <[email protected]> CC: Marek Szyprowski <[email protected]> CC: Yassine Oudjana <[email protected]> CC: Tony Lindgren <[email protected]> CC: Neil Armstrong <[email protected]> CC: Maxime Ripard <[email protected]>
Hi Maxime, I love your patch! Perhaps something to improve: [auto build test WARNING on clk/clk-next] [also build test WARNING on linus/master v5.18-rc6 next-20220512] [cannot apply to anholt/for-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/intel-lab-lkp/linux/commits/Maxime-Ripard/clk-More-clock-rate-fixes-and-tests/20220513-001815 base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next :::::: branch date: 19 hours ago :::::: commit date: 19 hours ago config: arm-randconfig-c002-20220512 (https://download.01.org/0day-ci/archive/20220513/[email protected]/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 9519dacab7b8afd537811fc2abaceb4d14f4e16a) 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 # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/intel-lab-lkp/linux/commit/ede926b8462a345ebef7dccca9568e625707ac84 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Maxime-Ripard/clk-More-clock-rate-fixes-and-tests/20220513-001815 git checkout ede926b8462a345ebef7dccca9568e625707ac84 # save the config file COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^ drivers/media/dvb-frontends/stb0899_priv.h:61:61: note: expanded from macro 'STB0899_SETFIELD_VAL' #define STB0899_SETFIELD_VAL(bitf, mask, val) (mask = (mask & (~(((1 << STB0899_WIDTH_##bitf) - 1) <<\ ~~~~ ^ Suppressed 50 warnings (49 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 39 warnings generated. drivers/rtc/rtc-ds1347.c:135:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(&config, 0, sizeof(config)); ^ include/linux/fortify-string.h:272:25: note: expanded from macro 'memset' #define memset(p, c, s) __fortify_memset_chk(p, c, s, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk' __underlying_memset(p, c, __fortify_size); \ ^~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset' #define __underlying_memset __builtin_memset ^~~~~~~~~~~~~~~~ drivers/rtc/rtc-ds1347.c:135:2: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 memset(&config, 0, sizeof(config)); ^ include/linux/fortify-string.h:272:25: note: expanded from macro 'memset' #define memset(p, c, s) __fortify_memset_chk(p, c, s, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk' __underlying_memset(p, c, __fortify_size); \ ^~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset' #define __underlying_memset __builtin_memset ^~~~~~~~~~~~~~~~ Suppressed 38 warnings (38 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 36 warnings generated. Suppressed 36 warnings (36 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 38 warnings generated. Suppressed 38 warnings (38 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 49 warnings generated. Suppressed 49 warnings (49 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 51 warnings generated. Suppressed 51 warnings (50 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 51 warnings generated. Suppressed 51 warnings (50 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 51 warnings generated. Suppressed 51 warnings (50 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 22 warnings generated. Suppressed 22 warnings (22 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 41 warnings generated. drivers/firmware/memmap.c:301:3: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(entry, 0, sizeof(*entry)); ^ include/linux/fortify-string.h:272:25: note: expanded from macro 'memset' #define memset(p, c, s) __fortify_memset_chk(p, c, s, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk' __underlying_memset(p, c, __fortify_size); \ ^~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset' #define __underlying_memset __builtin_memset ^~~~~~~~~~~~~~~~ drivers/firmware/memmap.c:301:3: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 memset(entry, 0, sizeof(*entry)); ^ include/linux/fortify-string.h:272:25: note: expanded from macro 'memset' #define memset(p, c, s) __fortify_memset_chk(p, c, s, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk' __underlying_memset(p, c, __fortify_size); \ ^~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset' #define __underlying_memset __builtin_memset ^~~~~~~~~~~~~~~~ drivers/firmware/memmap.c:372:9: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return snprintf(buf, PAGE_SIZE, "0x%llx\n", ^~~~~~~~ drivers/firmware/memmap.c:372:9: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 return snprintf(buf, PAGE_SIZE, "0x%llx\n", ^~~~~~~~ drivers/firmware/memmap.c:378:9: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return snprintf(buf, PAGE_SIZE, "0x%llx\n", ^~~~~~~~ drivers/firmware/memmap.c:378:9: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 return snprintf(buf, PAGE_SIZE, "0x%llx\n", ^~~~~~~~ drivers/firmware/memmap.c:384:9: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] return snprintf(buf, PAGE_SIZE, "%s\n", entry->type); ^~~~~~~~ drivers/firmware/memmap.c:384:9: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 return snprintf(buf, PAGE_SIZE, "%s\n", entry->type); ^~~~~~~~ Suppressed 37 warnings (37 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 23 warnings generated. >> drivers/clk/clk_test.c:425:14: warning: Value stored to 'clk' during its >> initialization is never read [clang-analyzer-deadcode.DeadStores] struct clk *clk = hw->clk; ^~~ ~~~~~~~ drivers/clk/clk_test.c:425:14: note: Value stored to 'clk' during its initialization is never read struct clk *clk = hw->clk; ^~~ ~~~~~~~ drivers/clk/clk_test.c:455:14: warning: Value stored to 'clk' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct clk *clk = hw->clk; ^~~ ~~~~~~~ drivers/clk/clk_test.c:455:14: note: Value stored to 'clk' during its initialization is never read struct clk *clk = hw->clk; ^~~ ~~~~~~~ drivers/clk/clk_test.c:553:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(&init, 0, sizeof(init)); ^ include/linux/fortify-string.h:272:25: note: expanded from macro 'memset' #define memset(p, c, s) __fortify_memset_chk(p, c, s, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk' __underlying_memset(p, c, __fortify_size); \ ^~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset' #define __underlying_memset __builtin_memset ^~~~~~~~~~~~~~~~ drivers/clk/clk_test.c:553:2: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 memset(&init, 0, sizeof(init)); ^ include/linux/fortify-string.h:272:25: note: expanded from macro 'memset' #define memset(p, c, s) __fortify_memset_chk(p, c, s, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk' __underlying_memset(p, c, __fortify_size); \ ^~~~~~~~~~~~~~~~~~~ include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset' #define __underlying_memset __builtin_memset ^~~~~~~~~~~~~~~~ Suppressed 20 warnings (20 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 26 warnings generated. drivers/clk/clk-divider.c:330:9: warning: Division by zero [clang-analyzer-core.DivideZero] now = DIV_ROUND_UP_ULL((u64)parent_rate, i); ^ include/linux/math.h:43:2: note: expanded from macro 'DIV_ROUND_UP_ULL' DIV_ROUND_DOWN_ULL((unsigned long long)(ll) + (d) - 1, (d)) ^ include/linux/math.h:40:37: note: expanded from macro 'DIV_ROUND_DOWN_ULL' ({ unsigned long long _tmp = (ll); do_div(_tmp, d); _tmp; }) ^ include/asm-generic/div64.h:235:25: note: expanded from macro 'do_div' __rem = (uint32_t)(n) % __base; \ ^ drivers/clk/clk-divider.c:455:6: note: Assuming the condition is false if (divider->flags & CLK_DIVIDER_READ_ONLY) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/clk/clk-divider.c:455:2: note: Taking false branch if (divider->flags & CLK_DIVIDER_READ_ONLY) { ^ drivers/clk/clk-divider.c:466:9: note: Calling 'divider_determine_rate' return divider_determine_rate(hw, req, divider->table, divider->width, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/clk/clk-divider.c:352:8: note: Calling 'clk_divider_bestdiv' div = clk_divider_bestdiv(hw, req->best_parent_hw, req->rate, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/clk/clk-divider.c:299:6: note: Assuming 'rate' is 0 if (!rate) ^~~~~ drivers/clk/clk-divider.c:299:2: note: Taking true branch if (!rate) ^ drivers/clk/clk-divider.c:302:11: note: Calling '_get_maxdiv' maxdiv = _get_maxdiv(table, width, flags); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/clk/clk-divider.c:71:6: note: Assuming the condition is false if (flags & CLK_DIVIDER_ONE_BASED) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/clk/clk-divider.c:71:2: note: Taking false branch if (flags & CLK_DIVIDER_ONE_BASED) ^ drivers/clk/clk-divider.c:73:6: note: Assuming the condition is false if (flags & CLK_DIVIDER_POWER_OF_TWO) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/clk/clk-divider.c:73:2: note: Taking false branch if (flags & CLK_DIVIDER_POWER_OF_TWO) ^ drivers/clk/clk-divider.c:75:6: note: Assuming 'table' is non-null, which participates in a condition later if (table) ^~~~~ drivers/clk/clk-divider.c:75:2: note: Taking true branch if (table) ^ drivers/clk/clk-divider.c:302:11: note: Returning from '_get_maxdiv' maxdiv = _get_maxdiv(table, width, flags); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/clk/clk-divider.c:304:6: note: Assuming the condition is false if (!(clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/clk/clk-divider.c:304:2: note: Taking false branch if (!(clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)) { ^ drivers/clk/clk-divider.c:316:11: note: '__UNIQUE_ID___x166' is >= '__UNIQUE_ID___y167' maxdiv = min(ULONG_MAX / rate, maxdiv); vim +/clk +425 drivers/clk/clk_test.c ede926b8462a34 Maxime Ripard 2022-05-12 410 ede926b8462a34 Maxime Ripard 2022-05-12 411 /* ede926b8462a34 Maxime Ripard 2022-05-12 412 * Test that for a clock that can't modify its rate and with a single ede926b8462a34 Maxime Ripard 2022-05-12 413 * parent, if we set disjoints range on the parent and then the child, ede926b8462a34 Maxime Ripard 2022-05-12 414 * the second will return an error. ede926b8462a34 Maxime Ripard 2022-05-12 415 * ede926b8462a34 Maxime Ripard 2022-05-12 416 * FIXME: clk_set_rate_range() only considers the current clock when ede926b8462a34 Maxime Ripard 2022-05-12 417 * evaluating whether ranges are disjoints and not the upstream clocks ede926b8462a34 Maxime Ripard 2022-05-12 418 * ranges. ede926b8462a34 Maxime Ripard 2022-05-12 419 */ ede926b8462a34 Maxime Ripard 2022-05-12 420 static void ede926b8462a34 Maxime Ripard 2022-05-12 421 clk_test_single_parent_mux_set_range_disjoint_child_last(struct kunit *test) ede926b8462a34 Maxime Ripard 2022-05-12 422 { ede926b8462a34 Maxime Ripard 2022-05-12 423 struct clk_single_parent_ctx *ctx = test->priv; ede926b8462a34 Maxime Ripard 2022-05-12 424 struct clk_hw *hw = &ctx->hw; ede926b8462a34 Maxime Ripard 2022-05-12 @425 struct clk *clk = hw->clk; ede926b8462a34 Maxime Ripard 2022-05-12 426 struct clk *parent; ede926b8462a34 Maxime Ripard 2022-05-12 427 int ret; ede926b8462a34 Maxime Ripard 2022-05-12 428 ede926b8462a34 Maxime Ripard 2022-05-12 429 kunit_skip(test, "This needs to be fixed in the core."); ede926b8462a34 Maxime Ripard 2022-05-12 430 ede926b8462a34 Maxime Ripard 2022-05-12 431 parent = clk_get_parent(clk); ede926b8462a34 Maxime Ripard 2022-05-12 432 KUNIT_ASSERT_PTR_NE(test, parent, NULL); ede926b8462a34 Maxime Ripard 2022-05-12 433 ede926b8462a34 Maxime Ripard 2022-05-12 434 ret = clk_set_rate_range(parent, 1000, 2000); ede926b8462a34 Maxime Ripard 2022-05-12 435 KUNIT_ASSERT_EQ(test, ret, 0); ede926b8462a34 Maxime Ripard 2022-05-12 436 ede926b8462a34 Maxime Ripard 2022-05-12 437 ret = clk_set_rate_range(clk, 3000, 4000); ede926b8462a34 Maxime Ripard 2022-05-12 438 KUNIT_EXPECT_LT(test, ret, 0); ede926b8462a34 Maxime Ripard 2022-05-12 439 } ede926b8462a34 Maxime Ripard 2022-05-12 440 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
