CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Michael Tretter <[email protected]>
CC: Vinod Koul <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   a763d5a5abd65797aec3dd1bf01fe2ccbec32967
commit: 7073b5a8bd6ea641b41568e2899b0977f79134e3 dmaengine: zynqmp_dma: enable 
COMPILE_TEST
date:   2 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 2 months ago
config: riscv-randconfig-c006-20211210 
(https://download.01.org/0day-ci/archive/20211213/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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-riscv64-linux-gnu
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7073b5a8bd6ea641b41568e2899b0977f79134e3
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 7073b5a8bd6ea641b41568e2899b0977f79134e3
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 
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/regulator/rohm-regulator.c:31:6: note: Assuming 'mask' is not equal 
to 0
           if (!mask) {
               ^~~~~
   drivers/regulator/rohm-regulator.c:31:2: note: Taking false branch
           if (!mask) {
           ^
   drivers/regulator/rohm-regulator.c:37:14: note: Assuming 'i' is < field 
'n_voltages'
           for (i = 0; i < desc->n_voltages; i++) {
                       ^~~~~~~~~~~~~~~~~~~~
   drivers/regulator/rohm-regulator.c:37:2: note: Loop condition is true.  
Entering loop body
           for (i = 0; i < desc->n_voltages; i++) {
           ^
   drivers/regulator/rohm-regulator.c:39:7: note: Assuming field 
'linear_range_selectors' is null
                   if (desc->linear_range_selectors)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/rohm-regulator.c:39:3: note: Taking false branch
                   if (desc->linear_range_selectors)
                   ^
   drivers/regulator/rohm-regulator.c:41:7: note: Assuming field 
'n_linear_ranges' is 0
                   if (desc->n_linear_ranges)
                       ^~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/rohm-regulator.c:41:3: note: Taking false branch
                   if (desc->n_linear_ranges)
                   ^
   drivers/regulator/rohm-regulator.c:45:7: note: Assuming 'ret' is >= 0
                   if (ret < 0)
                       ^~~~~~~
   drivers/regulator/rohm-regulator.c:45:3: note: Taking false branch
                   if (ret < 0)
                   ^
   drivers/regulator/rohm-regulator.c:47:7: note: Assuming 'ret' is equal to 
'uv'
                   if (ret == uv) {
                       ^~~~~~~~~
   drivers/regulator/rohm-regulator.c:47:3: note: Taking true branch
                   if (ret == uv) {
                   ^
   drivers/regulator/rohm-regulator.c:48:6: note: Assigned value is garbage or 
undefined
                           i <<= ffs(desc->vsel_mask) - 1;
                             ^   ~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 5 warnings (5 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   7 warnings generated.
   drivers/mfd/sm501.c:513:16: warning: Value stored to 'mode' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long mode = smc501_readl(sm->regs + 
SM501_POWER_MODE_CONTROL);
                         ^~~~
   drivers/mfd/sm501.c:513:16: note: Value stored to 'mode' during its 
initialization is never read
           unsigned long mode = smc501_readl(sm->regs + 
SM501_POWER_MODE_CONTROL);
                         ^~~~
   drivers/mfd/sm501.c:514:16: warning: Value stored to 'gate' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
                         ^~~~
   drivers/mfd/sm501.c:514:16: note: Value stored to 'gate' during its 
initialization is never read
           unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
                         ^~~~
   drivers/mfd/sm501.c:515:16: warning: Value stored to 'clock' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
                         ^~~~~
   drivers/mfd/sm501.c:515:16: note: Value stored to 'clock' during its 
initialization is never read
           unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
                         ^~~~~
   Suppressed 4 warnings (3 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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   5 warnings generated.
>> drivers/dma/xilinx/zynqmp_dma.c:359:2: warning: Value stored to 'val' is 
>> never read [clang-analyzer-deadcode.DeadStores]
           val = readl(chan->regs + ZYNQMP_DMA_IRQ_SRC_ACCT);
           ^
   drivers/dma/xilinx/zynqmp_dma.c:359:2: note: Value stored to 'val' is never 
read
   drivers/dma/xilinx/zynqmp_dma.c:360:2: warning: Value stored to 'val' is 
never read [clang-analyzer-deadcode.DeadStores]
           val = readl(chan->regs + ZYNQMP_DMA_IRQ_DST_ACCT);
           ^
   drivers/dma/xilinx/zynqmp_dma.c:360:2: note: Value stored to 'val' is never 
read
   Suppressed 3 warnings (3 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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   4 warnings generated.
   Suppressed 4 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   6 warnings generated.
   drivers/nvme/host/ioctl.c:230:7: warning: Assigned value is garbage or 
undefined [clang-analyzer-core.uninitialized.Assign]
                   if (put_user(result, &ucmd->result))
                       ^
   arch/riscv/include/asm/uaccess.h:354:3: note: expanded from macro 'put_user'
                   __put_user((x), __p) :                          \
                   ^
   arch/riscv/include/asm/uaccess.h:321:2: note: expanded from macro 
'__put_user'
           __typeof__(*__gu_ptr) __val = (x);                      \
           ^
   drivers/nvme/host/ioctl.c:479:2: note: Control jumps to 'case 3225964097:'  
at line 480
           switch (cmd) {
           ^
   drivers/nvme/host/ioctl.c:481:10: note: Calling 'nvme_user_cmd'
                   return nvme_user_cmd(ctrl, NULL, argp);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/ioctl.c:196:2: note: 'result' declared without an initial 
value
           u64 result;
           ^~~~~~~~~~
   drivers/nvme/host/ioctl.c:199:6: note: Assuming the condition is false
           if (!capable(CAP_SYS_ADMIN))
               ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/ioctl.c:199:2: note: Taking false branch
           if (!capable(CAP_SYS_ADMIN))
           ^
   drivers/nvme/host/ioctl.c:201:6: note: Calling 'copy_from_user'
           if (copy_from_user(&cmd, ucmd, sizeof(cmd)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:191:2: note: Taking true branch
           if (likely(check_copy_size(to, n, false)))
           ^
   include/linux/uaccess.h:192:7: note: Value assigned to 'cmd.flags', which 
participates in a condition later
                   n = _copy_from_user(to, from, n);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:193:2: note: Returning value (loaded from 'n'), 
which participates in a condition later
           return n;
           ^~~~~~~~
   drivers/nvme/host/ioctl.c:201:6: note: Returning from 'copy_from_user'
           if (copy_from_user(&cmd, ucmd, sizeof(cmd)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/ioctl.c:201:6: note: Assuming the condition is false
           if (copy_from_user(&cmd, ucmd, sizeof(cmd)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/ioctl.c:201:2: note: Taking false branch
           if (copy_from_user(&cmd, ucmd, sizeof(cmd)))
           ^
   drivers/nvme/host/ioctl.c:203:6: note: Assuming field 'flags' is 0
           if (cmd.flags)
               ^~~~~~~~~
   drivers/nvme/host/ioctl.c:203:2: note: Taking false branch
           if (cmd.flags)
           ^

vim +/val +359 drivers/dma/xilinx/zynqmp_dma.c

b0cc417c163719 Kedareswara rao Appana 2016-07-01  329  
b0cc417c163719 Kedareswara rao Appana 2016-07-01  330  /**
b0cc417c163719 Kedareswara rao Appana 2016-07-01  331   * zynqmp_dma_init - 
Initialize the channel
b0cc417c163719 Kedareswara rao Appana 2016-07-01  332   * @chan: ZynqMP DMA 
channel pointer
b0cc417c163719 Kedareswara rao Appana 2016-07-01  333   */
b0cc417c163719 Kedareswara rao Appana 2016-07-01  334  static void 
zynqmp_dma_init(struct zynqmp_dma_chan *chan)
b0cc417c163719 Kedareswara rao Appana 2016-07-01  335  {
b0cc417c163719 Kedareswara rao Appana 2016-07-01  336   u32 val;
b0cc417c163719 Kedareswara rao Appana 2016-07-01  337  
b0cc417c163719 Kedareswara rao Appana 2016-07-01  338   
writel(ZYNQMP_DMA_IDS_DEFAULT_MASK, chan->regs + ZYNQMP_DMA_IDS);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  339   val = readl(chan->regs 
+ ZYNQMP_DMA_ISR);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  340   writel(val, chan->regs 
+ ZYNQMP_DMA_ISR);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  341  
b0cc417c163719 Kedareswara rao Appana 2016-07-01  342   if 
(chan->is_dmacoherent) {
b0cc417c163719 Kedareswara rao Appana 2016-07-01  343           val = 
ZYNQMP_DMA_AXCOHRNT;
b0cc417c163719 Kedareswara rao Appana 2016-07-01  344           val = (val & 
~ZYNQMP_DMA_AXCACHE) |
b0cc417c163719 Kedareswara rao Appana 2016-07-01  345                   
(ZYNQMP_DMA_AXCACHE_VAL << ZYNQMP_DMA_AXCACHE_OFST);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  346           writel(val, 
chan->regs + ZYNQMP_DMA_DSCR_ATTR);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  347   }
b0cc417c163719 Kedareswara rao Appana 2016-07-01  348  
b0cc417c163719 Kedareswara rao Appana 2016-07-01  349   val = readl(chan->regs 
+ ZYNQMP_DMA_DATA_ATTR);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  350   if 
(chan->is_dmacoherent) {
b0cc417c163719 Kedareswara rao Appana 2016-07-01  351           val = (val & 
~ZYNQMP_DMA_ARCACHE) |
b0cc417c163719 Kedareswara rao Appana 2016-07-01  352                   
(ZYNQMP_DMA_AXCACHE_VAL << ZYNQMP_DMA_ARCACHE_OFST);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  353           val = (val & 
~ZYNQMP_DMA_AWCACHE) |
b0cc417c163719 Kedareswara rao Appana 2016-07-01  354                   
(ZYNQMP_DMA_AXCACHE_VAL << ZYNQMP_DMA_AWCACHE_OFST);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  355   }
b0cc417c163719 Kedareswara rao Appana 2016-07-01  356   writel(val, chan->regs 
+ ZYNQMP_DMA_DATA_ATTR);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  357  
b0cc417c163719 Kedareswara rao Appana 2016-07-01  358   /* Clearing the 
interrupt account rgisters */
b0cc417c163719 Kedareswara rao Appana 2016-07-01 @359   val = readl(chan->regs 
+ ZYNQMP_DMA_IRQ_SRC_ACCT);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  360   val = readl(chan->regs 
+ ZYNQMP_DMA_IRQ_DST_ACCT);
b0cc417c163719 Kedareswara rao Appana 2016-07-01  361  
b0cc417c163719 Kedareswara rao Appana 2016-07-01  362   chan->idle = true;
b0cc417c163719 Kedareswara rao Appana 2016-07-01  363  }
b0cc417c163719 Kedareswara rao Appana 2016-07-01  364  

:::::: The code at line 359 was first introduced by commit
:::::: b0cc417c1637192be658e68a74c8d1568e3d35f6 dmaengine: Add Xilinx zynqmp 
dma engine driver support

:::::: TO: Kedareswara rao Appana <[email protected]>
:::::: CC: Vinod Koul <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to