CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Pratyush Yadav <[email protected]>
CC: Vignesh Raghavendra <[email protected]>

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head:   38db5241d050c8022baf56d60b40d9a805809c8b
commit: be58a6d2184f996fa51cb83c98426fd634606d63 [109/9999] spi: cadence-qspi: 
Tune PHY to allow running at higher frequencies
:::::: branch date: 2 days ago
:::::: commit date: 11 months ago
config: riscv-randconfig-c006-20220213 
(https://download.01.org/0day-ci/archive/20220214/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
ea071884b0cc7210b3cc5fe858f0e892a779a23b)
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
        git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
        git fetch --no-tags ti ti-rt-linux-5.10.y
        git checkout be58a6d2184f996fa51cb83c98426fd634606d63
        # 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 >>)
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:315:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:303:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:293:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   drivers/spi/spi-amd.c:176:2: note: Loop condition is true.  Entering loop 
body
           list_for_each_entry(xfer, &message->transfers,
           ^
   include/linux/list.h:628:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   drivers/spi/spi-amd.c:178:7: note: Assuming pointer value is null
                   if (xfer->rx_buf)
                       ^~~~~~~~~~~~
   drivers/spi/spi-amd.c:178:7: note: Assuming field 'rx_buf' is null
                   if (xfer->rx_buf)
                       ^~~~~~~~~~~~
   drivers/spi/spi-amd.c:178:3: note: Taking false branch
                   if (xfer->rx_buf)
                   ^
   drivers/spi/spi-amd.c:180:7: note: Assuming field 'tx_buf' is null
                   if (xfer->tx_buf)
                       ^~~~~~~~~~~~
   drivers/spi/spi-amd.c:180:3: note: Taking false branch
                   if (xfer->tx_buf)
                   ^
   drivers/spi/spi-amd.c:183:3: note: Taking false branch
                   if (m_cmd & AMD_SPI_XFER_TX) {
                   ^
   drivers/spi/spi-amd.c:202:3: note: Taking true branch
                   if (m_cmd & AMD_SPI_XFER_RX) {
                   ^
   drivers/spi/spi-amd.c:208:4: note: Null pointer value stored to 'buf'
                           buf = (u8 *)xfer->rx_buf;
                           ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-amd.c:214:16: note: Assuming 'i' is < 'rx_len'
                           for (i = 0; i < rx_len; i++)
                                       ^~~~~~~~~~
   drivers/spi/spi-amd.c:214:4: note: Loop condition is true.  Entering loop 
body
                           for (i = 0; i < rx_len; i++)
                           ^
   drivers/spi/spi-amd.c:215:12: note: Array access (from variable 'buf') 
results in a null pointer dereference
                                   buf[i] = amd_spi_readreg8(master,
                                   ~~~    ^
   Suppressed 7 warnings (7 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.
   8 warnings generated.
   Suppressed 8 warnings (7 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   8 warnings generated.
   mm/oom_kill.c:255:17: warning: Value stored to 'highest_zoneidx' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           enum zone_type highest_zoneidx = gfp_zone(oc->gfp_mask);
                          ^~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
   mm/oom_kill.c:255:17: note: Value stored to 'highest_zoneidx' during its 
initialization is never read
           enum zone_type highest_zoneidx = gfp_zone(oc->gfp_mask);
                          ^~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   8 warnings generated.
   mm/page-writeback.c:1408:14: warning: The result of the left shift is 
undefined because the right operand is negative 
[clang-analyzer-core.UndefinedBinaryOperatorResult]
                   return 1UL << (ilog2(thresh - dirty) >> 1);
                              ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/page-writeback.c:1407:6: note: Assuming 'thresh' is > 'dirty'
           if (thresh > dirty)
               ^~~~~~~~~~~~~~
   mm/page-writeback.c:1407:2: note: Taking true branch
           if (thresh > dirty)
           ^
   mm/page-writeback.c:1408:18: note: '?' condition is false
                   return 1UL << (ilog2(thresh - dirty) >> 1);
                                  ^
   include/linux/log2.h:158:2: note: expanded from macro 'ilog2'
           __builtin_constant_p(n) ?       \
           ^
   mm/page-writeback.c:1408:18: note: '?' condition is false
                   return 1UL << (ilog2(thresh - dirty) >> 1);
                                  ^
   include/linux/log2.h:160:2: note: expanded from macro 'ilog2'
           (sizeof(n) <= 4) ?              \
           ^
   mm/page-writeback.c:1408:14: note: The result of the left shift is undefined 
because the right operand is negative
                   return 1UL << (ilog2(thresh - dirty) >> 1);
                              ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 7 warnings (7 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.
   14 warnings generated.
>> drivers/spi/spi-cadence-quadspi.c:381:17: warning: Value stored to 'dev' 
>> during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &f_pdata->cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:381:17: note: Value stored to 'dev' during 
its initialization is never read
           struct device *dev = &f_pdata->cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:405:17: warning: Value stored to 'dev' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &f_pdata->cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:405:17: note: Value stored to 'dev' during 
its initialization is never read
           struct device *dev = &f_pdata->cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:429:17: warning: Value stored to 'dev' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &f_pdata->cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:429:17: note: Value stored to 'dev' during 
its initialization is never read
           struct device *dev = &f_pdata->cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:453:17: warning: Value stored to 'dev' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &f_pdata->cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:453:17: note: Value stored to 'dev' during 
its initialization is never read
           struct device *dev = &f_pdata->cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:1901:3: warning: Value stored to 'buf' is 
never read [clang-analyzer-deadcode.DeadStores]
                   buf += (from + len) - to_aligned;
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:1901:3: note: Value stored to 'buf' is 
never read
                   buf += (from + len) - to_aligned;
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:1987:17: warning: Value stored to 'dev' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:1987:17: note: Value stored to 'dev' 
during its initialization is never read
           struct device *dev = &cqspi->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:2151:22: warning: Value stored to 'np' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device_node *np = dev->of_node;
                               ^~   ~~~~~~~~~~~~
   drivers/spi/spi-cadence-quadspi.c:2151:22: note: Value stored to 'np' during 
its initialization is never read
           struct device_node *np = dev->of_node;
                               ^~   ~~~~~~~~~~~~
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   9 warnings generated.
   drivers/spi/spi-mxic.c:381:7: warning: The result of the left shift is 
undefined because the left operand is negative 
[clang-analyzer-core.UndefinedBinaryOperatorResult]
                              OP_ADDR_BUSW(fls(op->addr.buswidth) - 1);
                              ^
   drivers/spi/spi-mxic.c:80:31: note: expanded from macro 'OP_ADDR_BUSW'
   #define OP_ADDR_BUSW(x)         ((x) << 3)
                                    ~~~ ^
   drivers/spi/spi-mxic.c:361:8: note: Calling 'mxic_spi_set_freq'
           ret = mxic_spi_set_freq(mxic, mem->spi->max_speed_hz);

vim +/dev +381 drivers/spi/spi-cadence-quadspi.c

be58a6d2184f99 Pratyush Yadav 2021-03-22  377  
be58a6d2184f99 Pratyush Yadav 2021-03-22  378  static int 
cqspi_find_rx_low(struct cqspi_flash_pdata *f_pdata,
be58a6d2184f99 Pratyush Yadav 2021-03-22  379                        struct 
spi_mem *mem, struct phy_setting *phy)
be58a6d2184f99 Pratyush Yadav 2021-03-22  380  {
be58a6d2184f99 Pratyush Yadav 2021-03-22 @381   struct device *dev = 
&f_pdata->cqspi->pdev->dev;
be58a6d2184f99 Pratyush Yadav 2021-03-22  382   int ret;
be58a6d2184f99 Pratyush Yadav 2021-03-22  383  
be58a6d2184f99 Pratyush Yadav 2021-03-22  384   do {
be58a6d2184f99 Pratyush Yadav 2021-03-22  385           phy->rx = 0;
be58a6d2184f99 Pratyush Yadav 2021-03-22  386           do {
be58a6d2184f99 Pratyush Yadav 2021-03-22  387                   
cqspi_phy_apply_setting(f_pdata, phy);
be58a6d2184f99 Pratyush Yadav 2021-03-22  388                   ret = 
cqspi_phy_check_pattern(f_pdata, mem);
be58a6d2184f99 Pratyush Yadav 2021-03-22  389                   if (!ret)
be58a6d2184f99 Pratyush Yadav 2021-03-22  390                           return 
0;
be58a6d2184f99 Pratyush Yadav 2021-03-22  391  
be58a6d2184f99 Pratyush Yadav 2021-03-22  392                   phy->rx++;
be58a6d2184f99 Pratyush Yadav 2021-03-22  393           } while (phy->rx <= 
CQSPI_PHY_LOW_RX_BOUND);
be58a6d2184f99 Pratyush Yadav 2021-03-22  394  
be58a6d2184f99 Pratyush Yadav 2021-03-22  395           phy->read_delay++;
be58a6d2184f99 Pratyush Yadav 2021-03-22  396   } while (phy->read_delay <= 
CQSPI_PHY_MAX_RD);
be58a6d2184f99 Pratyush Yadav 2021-03-22  397  
be58a6d2184f99 Pratyush Yadav 2021-03-22  398   dev_dbg(dev, "Unable to find RX 
low\n");
be58a6d2184f99 Pratyush Yadav 2021-03-22  399   return -ENOENT;
be58a6d2184f99 Pratyush Yadav 2021-03-22  400  }
be58a6d2184f99 Pratyush Yadav 2021-03-22  401  

---
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