:::::: :::::: Manual check reason: "low confidence static check warning: drivers/media/platform/atmel/atmel-isc-clk.c:125:18: warning: Value stored to 'isc_clk' during its initialization is never read [clang-analyzer-deadcode.DeadStores]" ::::::
CC: [email protected] CC: [email protected] BCC: [email protected] CC: [email protected] TO: Eugen Hristev <[email protected]> CC: Mauro Carvalho Chehab <[email protected]> CC: [email protected] CC: Jacopo Mondi <[email protected]> CC: Hans Verkuil <[email protected]> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 952923ddc01120190dcf671e7b354364ce1d1362 commit: 118bf76a35bc2ed061cd1454fe5e57d1c7bcd8d0 media: atmel: atmel-isc: split the clock code into separate source file date: 4 months ago :::::: branch date: 5 hours ago :::::: commit date: 4 months ago config: arm-randconfig-c002-20220605 (https://download.01.org/0day-ci/archive/20220605/[email protected]/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0a90b72c432d70aae035727ece4ba80ce820f381) 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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=118bf76a35bc2ed061cd1454fe5e57d1c7bcd8d0 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 118bf76a35bc2ed061cd1454fe5e57d1c7bcd8d0 # 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 where applicable Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^~~~~ fs/xfs/libxfs/xfs_ialloc.c:1084:4: note: Taking false branch if (error) ^ fs/xfs/libxfs/xfs_ialloc.c:1091:10: note: Left side of '&&' is true while (--searchdistance > 0 && (!doneleft || !doneright)) { ^ fs/xfs/libxfs/xfs_ialloc.c:1091:36: note: 'doneleft' is 1 while (--searchdistance > 0 && (!doneleft || !doneright)) { ^~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:1091:35: note: Left side of '||' is false while (--searchdistance > 0 && (!doneleft || !doneright)) { ^ fs/xfs/libxfs/xfs_ialloc.c:1091:48: note: Assuming 'doneright' is 0 while (--searchdistance > 0 && (!doneleft || !doneright)) { ^~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:1091:3: note: Loop condition is true. Entering loop body while (--searchdistance > 0 && (!doneleft || !doneright)) { ^ fs/xfs/libxfs/xfs_ialloc.c:1095:9: note: 'doneleft' is 1 if (!doneleft && !doneright) { ^~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:1095:18: note: Left side of '&&' is false if (!doneleft && !doneright) { ^ fs/xfs/libxfs/xfs_ialloc.c:1104:8: note: 'useleft' is 0 if (useleft && trec.ir_freecount) { ^~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:1104:16: note: Left side of '&&' is false if (useleft && trec.ir_freecount) { ^ fs/xfs/libxfs/xfs_ialloc.c:1116:9: note: 'useleft' is 0 if (!useleft && rec.ir_freecount) { ^~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:1116:8: note: Left side of '&&' is true if (!useleft && rec.ir_freecount) { ^ fs/xfs/libxfs/xfs_ialloc.c:1116:20: note: Assuming field 'ir_freecount' is not equal to 0 if (!useleft && rec.ir_freecount) { ^~~~~~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:1116:4: note: Taking true branch if (!useleft && rec.ir_freecount) { ^ fs/xfs/libxfs/xfs_ialloc.c:1119:23: note: Assigned value is garbage or undefined pag->pagl_leftrec = trec.ir_startino; ^ ~~~~~~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:2669:33: warning: The left operand of '>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult] if (error || irec.ir_startino > high) ^ fs/xfs/libxfs/xfs_ialloc.c:2704:9: note: Calling 'xfs_ialloc_has_inode_record' return xfs_ialloc_has_inode_record(cur, low, high, exists); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:2666:10: note: Calling 'xfs_inobt_lookup' error = xfs_inobt_lookup(cur, low, XFS_LOOKUP_LE, &has_record); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:46:9: note: Value assigned to 'has_record', which participates in a condition later return xfs_btree_lookup(cur, dir, stat); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:2666:10: note: Returning from 'xfs_inobt_lookup' error = xfs_inobt_lookup(cur, low, XFS_LOOKUP_LE, &has_record); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:2667:9: note: Assuming 'error' is equal to 0 while (error == 0 && has_record) { ^~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:2667:9: note: Left side of '&&' is true fs/xfs/libxfs/xfs_ialloc.c:2667:2: note: Loop condition is true. Entering loop body while (error == 0 && has_record) { ^ fs/xfs/libxfs/xfs_ialloc.c:2668:11: note: Calling 'xfs_inobt_get_rec' error = xfs_inobt_get_rec(cur, &irec, &has_record); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:114:6: note: Assuming 'error' is 0, which participates in a condition later if (error || *stat == 0) ^~~~~ fs/xfs/libxfs/xfs_ialloc.c:114:6: note: Left side of '||' is false fs/xfs/libxfs/xfs_ialloc.c:114:15: note: Assuming the condition is true if (error || *stat == 0) ^~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:114:2: note: Taking true branch if (error || *stat == 0) ^ fs/xfs/libxfs/xfs_ialloc.c:115:3: note: Returning without writing to 'irec->ir_startino' return error; ^ fs/xfs/libxfs/xfs_ialloc.c:115:3: note: Returning zero (loaded from 'error'), which participates in a condition later return error; ^~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:2668:11: note: Returning from 'xfs_inobt_get_rec' error = xfs_inobt_get_rec(cur, &irec, &has_record); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/xfs/libxfs/xfs_ialloc.c:2669:7: note: 'error' is 0 if (error || irec.ir_startino > high) ^~~~~ fs/xfs/libxfs/xfs_ialloc.c:2669:7: note: Left side of '||' is false fs/xfs/libxfs/xfs_ialloc.c:2669:33: note: The left operand of '>' is a garbage value if (error || irec.ir_startino > high) ~~~~~~~~~~~~~~~~ ^ Suppressed 1 warnings (1 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. 2 warnings generated. >> drivers/media/platform/atmel/atmel-isc-clk.c:125:18: warning: Value stored >> to 'isc_clk' during its initialization is never read >> [clang-analyzer-deadcode.DeadStores] struct isc_clk *isc_clk = to_isc_clk(hw); ^~~~~~~ drivers/media/platform/atmel/atmel-isc-clk.c:125:18: note: Value stored to 'isc_clk' during its initialization is never read struct isc_clk *isc_clk = to_isc_clk(hw); ^~~~~~~ Suppressed 1 warnings (1 with check filters). 1 warning generated. Suppressed 1 warnings (1 with check filters). 1 warning generated. Suppressed 1 warnings (1 with check filters). 1 warning generated. Suppressed 1 warnings (1 with check filters). 1 warning generated. Suppressed 1 warnings (1 with check filters). 3 warnings generated. drivers/media/usb/airspy/airspy.c:246:16: warning: Value stored to 'msecs' during its initialization is never read [clang-analyzer-deadcode.DeadStores] unsigned int msecs = jiffies_to_msecs(jiffies - ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/airspy/airspy.c:246:16: note: Value stored to 'msecs' during its initialization is never read unsigned int msecs = jiffies_to_msecs(jiffies - ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/airspy/airspy.c:248:16: warning: Value stored to 'samples' during its initialization is never read [clang-analyzer-deadcode.DeadStores] unsigned int samples = s->sample - s->sample_measured; ^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/airspy/airspy.c:248:16: note: Value stored to 'samples' during its initialization is never read unsigned int samples = s->sample - s->sample_measured; ^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 1 warnings (1 with check filters). 19 warnings generated. drivers/media/usb/hackrf/hackrf.c:237:24: warning: Value stored to 'intf' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:237:24: note: Value stored to 'intf' during its initialization is never read struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:462:16: warning: Value stored to 'msecs' during its initialization is never read [clang-analyzer-deadcode.DeadStores] unsigned int msecs = jiffies_to_msecs(jiffies - ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:462:16: note: Value stored to 'msecs' during its initialization is never read unsigned int msecs = jiffies_to_msecs(jiffies - ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:464:16: warning: Value stored to 'samples' during its initialization is never read [clang-analyzer-deadcode.DeadStores] unsigned int samples = dev->sample - dev->sample_measured; ^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:464:16: note: Value stored to 'samples' during its initialization is never read unsigned int samples = dev->sample - dev->sample_measured; ^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:730:24: warning: Value stored to 'intf' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:730:24: note: Value stored to 'intf' during its initialization is never read struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:793:24: warning: Value stored to 'intf' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:793:24: note: Value stored to 'intf' during its initialization is never read struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:862:24: warning: Value stored to 'intf' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:862:24: note: Value stored to 'intf' during its initialization is never read struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:898:24: warning: Value stored to 'intf' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:898:24: note: Value stored to 'intf' during its initialization is never read struct usb_interface *intf = dev->intf; ^~~~ ~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:966:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:966:21: note: Value stored to 'dev' during its initialization is never read struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:988:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:988:21: note: Value stored to 'dev' during its initialization is never read struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:1003:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:1003:21: note: Value stored to 'dev' during its initialization is never read struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:1020:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:1020:21: note: Value stored to 'dev' during its initialization is never read struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:1049:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct hackrf_dev *dev = video_drvdata(file); ^~~ ~~~~~~~~~~~~~~~~~~~ drivers/media/usb/hackrf/hackrf.c:1049:21: note: Value stored to 'dev' during its initialization is never read struct hackrf_dev *dev = video_drvdata(file); vim +/isc_clk +125 drivers/media/platform/atmel/atmel-isc-clk.c 118bf76a35bc2e Eugen Hristev 2021-12-13 121 118bf76a35bc2e Eugen Hristev 2021-12-13 122 static int isc_clk_determine_rate(struct clk_hw *hw, 118bf76a35bc2e Eugen Hristev 2021-12-13 123 struct clk_rate_request *req) 118bf76a35bc2e Eugen Hristev 2021-12-13 124 { 118bf76a35bc2e Eugen Hristev 2021-12-13 @125 struct isc_clk *isc_clk = to_isc_clk(hw); 118bf76a35bc2e Eugen Hristev 2021-12-13 126 long best_rate = -EINVAL; 118bf76a35bc2e Eugen Hristev 2021-12-13 127 int best_diff = -1; 118bf76a35bc2e Eugen Hristev 2021-12-13 128 unsigned int i, div; 118bf76a35bc2e Eugen Hristev 2021-12-13 129 118bf76a35bc2e Eugen Hristev 2021-12-13 130 for (i = 0; i < clk_hw_get_num_parents(hw); i++) { 118bf76a35bc2e Eugen Hristev 2021-12-13 131 struct clk_hw *parent; 118bf76a35bc2e Eugen Hristev 2021-12-13 132 unsigned long parent_rate; 118bf76a35bc2e Eugen Hristev 2021-12-13 133 118bf76a35bc2e Eugen Hristev 2021-12-13 134 parent = clk_hw_get_parent_by_index(hw, i); 118bf76a35bc2e Eugen Hristev 2021-12-13 135 if (!parent) 118bf76a35bc2e Eugen Hristev 2021-12-13 136 continue; 118bf76a35bc2e Eugen Hristev 2021-12-13 137 118bf76a35bc2e Eugen Hristev 2021-12-13 138 parent_rate = clk_hw_get_rate(parent); 118bf76a35bc2e Eugen Hristev 2021-12-13 139 if (!parent_rate) 118bf76a35bc2e Eugen Hristev 2021-12-13 140 continue; 118bf76a35bc2e Eugen Hristev 2021-12-13 141 118bf76a35bc2e Eugen Hristev 2021-12-13 142 for (div = 1; div < ISC_CLK_MAX_DIV + 2; div++) { 118bf76a35bc2e Eugen Hristev 2021-12-13 143 unsigned long rate; 118bf76a35bc2e Eugen Hristev 2021-12-13 144 int diff; 118bf76a35bc2e Eugen Hristev 2021-12-13 145 118bf76a35bc2e Eugen Hristev 2021-12-13 146 rate = DIV_ROUND_CLOSEST(parent_rate, div); 118bf76a35bc2e Eugen Hristev 2021-12-13 147 diff = abs(req->rate - rate); 118bf76a35bc2e Eugen Hristev 2021-12-13 148 118bf76a35bc2e Eugen Hristev 2021-12-13 149 if (best_diff < 0 || best_diff > diff) { 118bf76a35bc2e Eugen Hristev 2021-12-13 150 best_rate = rate; 118bf76a35bc2e Eugen Hristev 2021-12-13 151 best_diff = diff; 118bf76a35bc2e Eugen Hristev 2021-12-13 152 req->best_parent_rate = parent_rate; 118bf76a35bc2e Eugen Hristev 2021-12-13 153 req->best_parent_hw = parent; 118bf76a35bc2e Eugen Hristev 2021-12-13 154 } 118bf76a35bc2e Eugen Hristev 2021-12-13 155 118bf76a35bc2e Eugen Hristev 2021-12-13 156 if (!best_diff || rate < req->rate) 118bf76a35bc2e Eugen Hristev 2021-12-13 157 break; 118bf76a35bc2e Eugen Hristev 2021-12-13 158 } 118bf76a35bc2e Eugen Hristev 2021-12-13 159 118bf76a35bc2e Eugen Hristev 2021-12-13 160 if (!best_diff) 118bf76a35bc2e Eugen Hristev 2021-12-13 161 break; 118bf76a35bc2e Eugen Hristev 2021-12-13 162 } 118bf76a35bc2e Eugen Hristev 2021-12-13 163 118bf76a35bc2e Eugen Hristev 2021-12-13 164 dev_dbg(isc_clk->dev, 118bf76a35bc2e Eugen Hristev 2021-12-13 165 "ISC CLK: %s, best_rate = %ld, parent clk: %s @ %ld\n", 118bf76a35bc2e Eugen Hristev 2021-12-13 166 __func__, best_rate, 118bf76a35bc2e Eugen Hristev 2021-12-13 167 __clk_get_name((req->best_parent_hw)->clk), 118bf76a35bc2e Eugen Hristev 2021-12-13 168 req->best_parent_rate); 118bf76a35bc2e Eugen Hristev 2021-12-13 169 118bf76a35bc2e Eugen Hristev 2021-12-13 170 if (best_rate < 0) 118bf76a35bc2e Eugen Hristev 2021-12-13 171 return best_rate; 118bf76a35bc2e Eugen Hristev 2021-12-13 172 118bf76a35bc2e Eugen Hristev 2021-12-13 173 req->rate = best_rate; 118bf76a35bc2e Eugen Hristev 2021-12-13 174 118bf76a35bc2e Eugen Hristev 2021-12-13 175 return 0; 118bf76a35bc2e Eugen Hristev 2021-12-13 176 } 118bf76a35bc2e Eugen Hristev 2021-12-13 177 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
