:::::: :::::: Manual check reason: "low confidence static check warning: drivers/phy/qualcomm/phy-qcom-qmp-pcie.c:1884:19: warning: Value stored to 'qmp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]" ::::::
CC: l...@lists.linux.dev CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: Linux Memory Management List <linux...@kvack.org> TO: Dmitry Baryshkov <dmitry.barysh...@linaro.org> CC: Vinod Koul <vk...@kernel.org> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 2f9cb3d3bd73fc2225d66aa8fcffb632ed3eb235 commit: fd9269945f34dccac3e6e33d8ba46c4628d2fc19 [1576/5720] phy: qcom-qmp-pcie: cleanup the driver :::::: branch date: 2 days ago :::::: commit date: 2 weeks ago config: riscv-randconfig-c006-20220617 compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 91688716ba49942051dccdf7b9c4f81a7ec8feaf) 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 riscv cross compiling tool for clang build # apt-get install binutils-riscv-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=fd9269945f34dccac3e6e33d8ba46c4628d2fc19 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout fd9269945f34dccac3e6e33d8ba46c4628d2fc19 # save the config file COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <l...@intel.com> clang-analyzer warnings: (new ones prefixed by >>) drivers/hwmon/max6621.c:316:2: note: Control jumps to 'case hwmon_temp:' at line 317 switch (type) { ^ drivers/hwmon/max6621.c:318:3: note: Control jumps to 'case hwmon_temp_offset:' at line 319 switch (attr) { ^ drivers/hwmon/max6621.c:321:10: note: Assuming '__UNIQUE_ID___x256' is <= '__UNIQUE_ID___y257' val = clamp_val(val, MAX6621_TEMP_INPUT_MIN, ^ include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val' #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:124:48: note: expanded from macro 'clamp_t' #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:112:27: note: expanded from macro 'max_t' #define max_t(type, x, y) __careful_cmp((type)(x), (type)(y), >) ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/minmax.h:104:48: note: expanded from macro 'min_t' #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ include/linux/minmax.h:38:14: note: expanded from macro '__careful_cmp' __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op)) ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:31:25: note: expanded from macro '__cmp_once' typeof(x) unique_x = (x); \ ^ drivers/hwmon/max6621.c:321:10: note: '?' condition is false val = clamp_val(val, MAX6621_TEMP_INPUT_MIN, ^ include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val' #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) ^ include/linux/minmax.h:124:48: note: expanded from macro 'clamp_t' #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi) ^ include/linux/minmax.h:112:27: note: expanded from macro 'max_t' #define max_t(type, x, y) __careful_cmp((type)(x), (type)(y), >) ^ include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp' __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op)) ^ include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once' __cmp(unique_x, unique_y, op); }) ^ include/linux/minmax.h:28:26: note: expanded from macro '__cmp' #define __cmp(x, y, op) ((x) op (y) ? (x) : (y)) ^ drivers/hwmon/max6621.c:321:10: note: '__UNIQUE_ID___x258' is < '__UNIQUE_ID___y259' val = clamp_val(val, MAX6621_TEMP_INPUT_MIN, ^ include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val' #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:124:36: note: expanded from macro 'clamp_t' #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:104:27: note: expanded from macro 'min_t' #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp' __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once' __cmp(unique_x, unique_y, op); }) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:28:26: note: expanded from macro '__cmp' #define __cmp(x, y, op) ((x) op (y) ? (x) : (y)) ^~~ drivers/hwmon/max6621.c:321:10: note: '?' condition is true val = clamp_val(val, MAX6621_TEMP_INPUT_MIN, ^ include/linux/minmax.h:137:32: note: expanded from macro 'clamp_val' #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) ^ include/linux/minmax.h:124:36: note: expanded from macro 'clamp_t' #define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi) ^ include/linux/minmax.h:104:27: note: expanded from macro 'min_t' #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) ^ include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp' __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op)) ^ include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once' __cmp(unique_x, unique_y, op); }) ^ include/linux/minmax.h:28:26: note: expanded from macro '__cmp' #define __cmp(x, y, op) ((x) op (y) ? (x) : (y)) ^ drivers/hwmon/max6621.c:323:10: note: Calling 'max6621_temp_mc2reg' val = max6621_temp_mc2reg(val); ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/hwmon/max6621.c:135:23: note: The result of the left shift is undefined because the left operand is negative return (val / 1000L) << MAX6621_REG_TEMP_SHIFT; ~~~~~~~~~~~~~ ^ Suppressed 45 warnings (45 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. 47 warnings generated. >> drivers/phy/qualcomm/phy-qcom-qmp-pcie.c:1884:19: warning: Value stored to >> 'qmp' during its initialization is never read >> [clang-analyzer-deadcode.DeadStores] struct qcom_qmp *qmp = qphy->qmp; ^~~ ~~~~~~~~~ drivers/phy/qualcomm/phy-qcom-qmp-pcie.c:1884:19: note: Value stored to 'qmp' during its initialization is never read struct qcom_qmp *qmp = qphy->qmp; ^~~ ~~~~~~~~~ drivers/phy/qualcomm/phy-qcom-qmp-pcie.c:2256:2: 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] snprintf(prop_name, sizeof(prop_name), "pipe%d", id); ^~~~~~~~ drivers/phy/qualcomm/phy-qcom-qmp-pcie.c:2256:2: 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 snprintf(prop_name, sizeof(prop_name), "pipe%d", id); ^~~~~~~~ Suppressed 45 warnings (45 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. 47 warnings generated. drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c:1104:2: 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] snprintf(prop_name, sizeof(prop_name), "pipe%d", id); ^~~~~~~~ drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c:1104:2: 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 snprintf(prop_name, sizeof(prop_name), "pipe%d", id); ^~~~~~~~ drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c:1121:3: 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] snprintf(prop_name, sizeof(prop_name), "lane%d", id); ^~~~~~~~ drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c:1121:3: 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 snprintf(prop_name, sizeof(prop_name), "lane%d", id); ^~~~~~~~ Suppressed 45 warnings (45 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. kernel/rcu/tree.c:2434:19: warning: Value stored to 'rnp' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct rcu_node *rnp = rdp->mynode; ^~~ ~~~~~~~~~~~ kernel/rcu/tree.c:2434:19: note: Value stored to 'rnp' during its initialization is never read struct rcu_node *rnp = rdp->mynode; ^~~ ~~~~~~~~~~~ kernel/rcu/tree.c:2499:19: warning: Value stored to 'rnp' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */ ^~~ ~~~~~~~~~~~ kernel/rcu/tree.c:2499:19: note: Value stored to 'rnp' during its initialization is never read struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */ ^~~ ~~~~~~~~~~~ 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. 47 warnings generated. drivers/video/backlight/qcom-wled.c:1126:3: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores] rc = regmap_update_bits(wled->regmap, addr, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/video/backlight/qcom-wled.c:1126:3: note: Value stored to 'rc' is never read rc = regmap_update_bits(wled->regmap, addr, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/video/backlight/qcom-wled.c:1710: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(&props, 0, sizeof(struct backlight_properties)); ^~~~~~ drivers/video/backlight/qcom-wled.c:1710: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(&props, 0, sizeof(struct backlight_properties)); ^~~~~~ Suppressed 45 warnings (45 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. 46 warnings generated. drivers/video/backlight/wm831x_bl.c:182: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(&props, 0, sizeof(props)); ^~~~~~ drivers/video/backlight/wm831x_bl.c:182: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(&props, 0, sizeof(props)); ^~~~~~ Suppressed 45 warnings (45 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. 45 warnings generated. Suppressed 45 warnings (45 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. 53 warnings generated. drivers/video/fbdev/core/fbmem.c:805:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] fb_memcpy_fromfb(dst, src, c); ^ include/linux/fb.h:584:26: note: expanded from macro 'fb_memcpy_fromfb' #define fb_memcpy_fromfb memcpy ^~~~~~ drivers/video/fbdev/core/fbmem.c:805:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11 fb_memcpy_fromfb(dst, src, c); ^ include/linux/fb.h:584:26: note: expanded from macro 'fb_memcpy_fromfb' #define fb_memcpy_fromfb memcpy ^~~~~~ drivers/video/fbdev/core/fbmem.c:806:3: warning: Value stored to 'dst' is never read [clang-analyzer-deadcode.DeadStores] dst += c; ^ ~ drivers/video/fbdev/core/fbmem.c:806:3: note: Value stored to 'dst' is never read dst += c; ^ ~ drivers/video/fbdev/core/fbmem.c:882:3: warning: Call to function 'memcpy' 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 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] fb_memcpy_tofb(dst, src, c); ^ include/linux/fb.h:585:24: note: expanded from macro 'fb_memcpy_tofb' #define fb_memcpy_tofb memcpy ^~~~~~ drivers/video/fbdev/core/fbmem.c:882:3: note: Call to function 'memcpy' 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 'memcpy_s' in case of C11 fb_memcpy_tofb(dst, src, c); ^ include/linux/fb.h:585:24: note: expanded from macro 'fb_memcpy_tofb' #define fb_memcpy_tofb memcpy vim +/qmp +1884 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1880 5dbc7d86d1aa25 Dmitry Baryshkov 2022-06-08 1881 static int qcom_qmp_phy_pcie_init(struct phy *phy) 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1882 { 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1883 struct qmp_phy *qphy = phy_get_drvdata(phy); 94a407cc17a445 Dmitry Baryshkov 2022-06-08 @1884 struct qcom_qmp *qmp = qphy->qmp; 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1885 int ret; 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1886 dev_vdbg(qmp->dev, "Initializing QMP phy\n"); 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1887 5dbc7d86d1aa25 Dmitry Baryshkov 2022-06-08 1888 ret = qcom_qmp_phy_pcie_com_init(qphy); 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1889 if (ret) 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1890 return ret; 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1891 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1892 return 0; 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1893 } 94a407cc17a445 Dmitry Baryshkov 2022-06-08 1894 :::::: The code at line 1884 was first introduced by commit :::::: 94a407cc17a445ddb3f7315cee0b0916d35d177c phy: qcom-qmp: create copies of QMP PHY driver :::::: TO: Dmitry Baryshkov <dmitry.barysh...@linaro.org> :::::: CC: Vinod Koul <vk...@kernel.org> -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org