CC: [email protected]
CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Dmitry Osipenko <[email protected]>
CC: Thierry Reding <[email protected]>
CC: Krzysztof Kozlowski <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   551acdc3c3d2b6bc97f11e31dcf960bc36343bfc
commit: 56ebc9b0d77e0406aba2d900c82e79204cc7dc32 memory: tegra: Enable compile 
testing for all drivers
date:   10 months ago
:::::: branch date: 28 hours ago
:::::: commit date: 10 months ago
config: arm-randconfig-c002-20220317 
(https://download.01.org/0day-ci/archive/20220319/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
a6ec1e3d798f8eab43fb3a91028c6ab04e115fcb)
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=56ebc9b0d77e0406aba2d900c82e79204cc7dc32
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 56ebc9b0d77e0406aba2d900c82e79204cc7dc32
        # save the config file to linux build tree
        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/hwtracing/coresight/coresight-core.c:469:3: note: Taking true branch
                   if (source_ops(csdev)->disable)
                   ^
   drivers/hwtracing/coresight/coresight-core.c:471:3: note: Calling 
'coresight_control_assoc_ectdev'
                   coresight_control_assoc_ectdev(csdev, false);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-core.c:273:6: note: Assuming 
'ect_csdev' is non-null
           if (!ect_csdev)
               ^~~~~~~~~~
   drivers/hwtracing/coresight/coresight-core.c:273:2: note: Taking false branch
           if (!ect_csdev)
           ^
   drivers/hwtracing/coresight/coresight-core.c:275:7: note: Assuming field 
'enable' is null
           if ((!ect_ops(ect_csdev)->enable) || (!ect_ops(ect_csdev)->disable))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-core.c:275:36: note: Left side of '||' 
is true
           if ((!ect_ops(ect_csdev)->enable) || (!ect_ops(ect_csdev)->disable))
                                             ^
   drivers/hwtracing/coresight/coresight-core.c:276:3: note: Returning without 
writing to 'csdev->enable', which participates in a condition later
                   return 0;
                   ^
   drivers/hwtracing/coresight/coresight-core.c:471:3: note: Returning from 
'coresight_control_assoc_ectdev'
                   coresight_control_assoc_ectdev(csdev, false);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-core.c:474:2: note: Returning the 
value 1, which participates in a condition later
           return !csdev->enable;
           ^~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-core.c:1180:25: note: Returning from 
'coresight_disable_source'
           if (!csdev->enable || !coresight_disable_source(csdev))
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-core.c:1180:2: note: Taking false 
branch
           if (!csdev->enable || !coresight_disable_source(csdev))
           ^
   drivers/hwtracing/coresight/coresight-core.c:1183:2: note: Control jumps to 
the 'default' case at line 1193
           switch (csdev->subtype.source_subtype) {
           ^
   drivers/hwtracing/coresight/coresight-core.c:1195:3: note:  Execution 
continues on line 1198
                   break;
                   ^
   drivers/hwtracing/coresight/coresight-core.c:1199:25: note: Passing null 
pointer value via 1st parameter 'path'
           coresight_release_path(path);
                                  ^~~~
   drivers/hwtracing/coresight/coresight-core.c:1199:2: note: Calling 
'coresight_release_path'
           coresight_release_path(path);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-core.c:880:2: note: Access to field 
'next' results in a dereference of a null pointer (loaded from variable 'path')
           list_for_each_entry_safe(nd, next, path, link) {
           ^
   include/linux/list.h:715:13: note: expanded from macro 
'list_for_each_entry_safe'
           for (pos = list_first_entry(head, typeof(*pos), member),        \
                      ^                ~~~~
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^           ~~~
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^            ~~~
   include/linux/kernel.h:703:25: note: expanded from macro 'container_of'
           void *__mptr = (void *)(ptr);                                   \
                                  ^~~~
   drivers/hwtracing/coresight/coresight-core.c:1737:4: warning: Value stored 
to 'idx' is never read [clang-analyzer-deadcode.DeadStores]
                           idx = -ENOMEM;
                           ^     ~~~~~~~
   drivers/hwtracing/coresight/coresight-core.c:1737:4: note: Value stored to 
'idx' is never read
                           idx = -ENOMEM;
                           ^     ~~~~~~~
   Suppressed 16 warnings (16 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   17 warnings generated.
   drivers/memory/tegra/mc.c:872:19: warning: Value stored to 'mc' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct tegra_mc *mc = dev_get_drvdata(dev);
                            ^~   ~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/mc.c:872:19: note: Value stored to 'mc' during its 
initialization is never read
           struct tegra_mc *mc = dev_get_drvdata(dev);
                            ^~   ~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/mc.c:886:19: warning: Value stored to 'mc' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct tegra_mc *mc = dev_get_drvdata(dev);
                            ^~   ~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/mc.c:886:19: note: Value stored to 'mc' during its 
initialization is never read
           struct tegra_mc *mc = dev_get_drvdata(dev);
                            ^~   ~~~~~~~~~~~~~~~~~~~~
   Suppressed 15 warnings (15 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   17 warnings generated.
>> drivers/memory/tegra/tegra210-emc-core.c:936:2: warning: Value stored to 
>> 'mpc_req' is never read [clang-analyzer-deadcode.DeadStores]
           mpc_req = emc_readl(emc, EMC_MPC);
           ^         ~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:936:2: note: Value stored to 
'mpc_req' is never read
           mpc_req = emc_readl(emc, EMC_MPC);
           ^         ~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/memory/tegra/tegra210-emc-core.c:1901:7: warning: Dereference of 
>> null pointer [clang-analyzer-core.NullDereference]
                   if (emc->timings[i].rate == current_rate) {
                       ^~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:1837:6: note: Assuming 'emc' is 
non-null
           if (!emc)
               ^~~~
   drivers/memory/tegra/tegra210-emc-core.c:1837:2: note: Taking false branch
           if (!emc)
           ^
   drivers/memory/tegra/tegra210-emc-core.c:1841:6: note: Calling 'IS_ERR'
           if (IS_ERR(emc->clk))
               ^~~~~~~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned 
long)-MAX_ERRNO)
                           
~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a 
condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:1841:6: note: Returning from 
'IS_ERR'
           if (IS_ERR(emc->clk))
               ^~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:1841:2: note: Taking false branch
           if (IS_ERR(emc->clk))
           ^
   drivers/memory/tegra/tegra210-emc-core.c:1844:2: note: Calling 
'platform_set_drvdata'
           platform_set_drvdata(pdev, emc);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/platform_device.h:248:2: note: Calling 'dev_set_drvdata'
           dev_set_drvdata(&pdev->dev, data);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/device.h:676:1: note: Returning without writing to 
'data->nominal', which participates in a condition later
   }
   ^
   include/linux/device.h:676:1: note: Returning without writing to 
'data->derated', which participates in a condition later
   include/linux/device.h:676:1: note: Returning without writing to 
'data->nominal'
   include/linux/device.h:676:1: note: Returning without writing to 
'data->timings'
   include/linux/platform_device.h:248:2: note: Returning from 'dev_set_drvdata'
           dev_set_drvdata(&pdev->dev, data);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/platform_device.h:249:1: note: Returning without writing to 
'data->nominal', which participates in a condition later
   }
   ^
   include/linux/platform_device.h:249:1: note: Returning without writing to 
'data->derated', which participates in a condition later
   include/linux/platform_device.h:249:1: note: Returning without writing to 
'data->nominal'
   include/linux/platform_device.h:249:1: note: Returning without writing to 
'data->timings'
   drivers/memory/tegra/tegra210-emc-core.c:1844:2: note: Returning from 
'platform_set_drvdata'
           platform_set_drvdata(pdev, emc);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:1845:2: note: Loop condition is 
false.  Exiting loop
           spin_lock_init(&emc->lock);
           ^
   include/linux/spinlock.h:334:35: note: expanded from macro 'spin_lock_init'
   # define spin_lock_init(lock)                                   \
                                                                   ^
   drivers/memory/tegra/tegra210-emc-core.c:1848:12: note: Value assigned to 
field 'nominal'
           emc->mc = devm_tegra_memory_controller_get(&pdev->dev);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:1849:6: note: Calling 'IS_ERR'
           if (IS_ERR(emc->mc))
               ^~~~~~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned 
long)-MAX_ERRNO)
                           
~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a 
condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:1849:6: note: Returning from 
'IS_ERR'
           if (IS_ERR(emc->mc))
               ^~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:1849:2: note: Taking false branch
           if (IS_ERR(emc->mc))
           ^
   drivers/memory/tegra/tegra210-emc-core.c:1853:6: note: Calling 'IS_ERR'
           if (IS_ERR(emc->regs))
               ^~~~~~~~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned 
long)-MAX_ERRNO)
                           
~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a 
condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-core.c:1853:6: note: Returning from 
'IS_ERR'
           if (IS_ERR(emc->regs))
--
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   17 warnings generated.
   include/linux/log2.h:67:13: warning: The result of the left shift is 
undefined due to shifting by '4294967295', which is greater or equal to the 
width of type 'unsigned long' 
[clang-analyzer-core.UndefinedBinaryOperatorResult]
           return 1UL << (fls_long(n) - 1);
                      ^
   drivers/hwtracing/coresight/coresight-stm.c:414:32: note: Left side of '&&' 
is false
           struct stm_drvdata *drvdata = container_of(stm_data,
                                         ^
   include/linux/kernel.h:704:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/hwtracing/coresight/coresight-stm.c:414:32: note: Taking false branch
           struct stm_drvdata *drvdata = container_of(stm_data,
                                         ^
   include/linux/kernel.h:704:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/hwtracing/coresight/coresight-stm.c:414:32: note: Loop condition is 
false.  Exiting loop
           struct stm_drvdata *drvdata = container_of(stm_data,
                                         ^
   include/linux/kernel.h:704:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:306:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   drivers/hwtracing/coresight/coresight-stm.c:418:8: note: Assuming 'drvdata' 
is non-null
           if (!(drvdata && local_read(&drvdata->mode)))
                 ^~~~~~~
   drivers/hwtracing/coresight/coresight-stm.c:418:8: note: Left side of '&&' 
is true
   drivers/hwtracing/coresight/coresight-stm.c:418:6: note: Assuming the 
condition is false
           if (!(drvdata && local_read(&drvdata->mode)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-stm.c:418:2: note: Taking false branch
           if (!(drvdata && local_read(&drvdata->mode)))
           ^
   drivers/hwtracing/coresight/coresight-stm.c:421:6: note: Assuming 'channel' 
is < field 'numsp'
           if (channel >= drvdata->numsp)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-stm.c:421:2: note: Taking false branch
           if (channel >= drvdata->numsp)
           ^
   drivers/hwtracing/coresight/coresight-stm.c:426:15: note: Assuming the 
condition is false
           stm_flags = (flags & STP_PACKET_TIMESTAMPED) ?
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-stm.c:426:14: note: '?' condition is 
false
           stm_flags = (flags & STP_PACKET_TIMESTAMPED) ?
                       ^
   drivers/hwtracing/coresight/coresight-stm.c:428:15: note: Assuming the 
condition is false
           stm_flags |= test_bit(channel, drvdata->chs.guaranteed) ?
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-stm.c:428:15: note: '?' condition is 
false
   drivers/hwtracing/coresight/coresight-stm.c:431:6: note: Assuming 'size' is 
<= field 'write_bytes'
           if (size > drvdata->write_bytes)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwtracing/coresight/coresight-stm.c:431:2: note: Taking false branch
           if (size > drvdata->write_bytes)
           ^
   drivers/hwtracing/coresight/coresight-stm.c:434:10: note: '?' condition is 
false
                   size = rounddown_pow_of_two(size);
                          ^
   include/linux/log2.h:193:2: note: expanded from macro 'rounddown_pow_of_two'
           __builtin_constant_p(n) ? (             \
           ^
   drivers/hwtracing/coresight/coresight-stm.c:434:10: note: Calling 
'__rounddown_pow_of_two'
                   size = rounddown_pow_of_two(size);
                          ^
   include/linux/log2.h:195:2: note: expanded from macro 'rounddown_pow_of_two'
           __rounddown_pow_of_two(n)               \
           ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/log2.h:67:13: note: The result of the left shift is undefined 
due to shifting by '4294967295', which is greater or equal to the width of type 
'unsigned long'
           return 1UL << (fls_long(n) - 1);
                      ^  ~~~~~~~~~~~~~~~~~
   Suppressed 16 warnings (16 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/memory/tegra/tegra210-emc-cc-r21021.c:148:15: warning: The left 
>> expression of the compound assignment is an uninitialized value. The 
>> computed value will also be garbage 
>> [clang-analyzer-core.uninitialized.Assign]
                           temp[i][0] |= (value & 0x00ff) >> 0;
                           ~~~~~~~~~~ ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:118:34: note: Assuming 'type' 
is not equal to PERIODIC_TRAINING_UPDATE
           bool periodic_training_update = type == PERIODIC_TRAINING_UPDATE;
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:123:21: note: Assuming 'type' 
is not equal to DVFS_UPDATE
           bool dvfs_update = type == DVFS_UPDATE;
                              ^~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:125:18: note: Assuming 'type' 
is equal to DVFS_PT1
           bool dvfs_pt1 = type == DVFS_PT1;
                           ^~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:133:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1 || periodic_training_update) {
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:133:15: note: Left side of 
'||' is true
           if (dvfs_pt1 || periodic_training_update) {
                        ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:136:15: note: Assuming 'i' is 
>= field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:136:3: note: Loop condition is 
false. Execution continues on line 145
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:147:15: note: Assuming 'i' is 
< field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:147:3: note: Loop condition is 
true.  Entering loop body
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:148:15: note: The left 
expression of the compound assignment is an uninitialized value. The computed 
value will also be garbage
                           temp[i][0] |= (value & 0x00ff) >> 0;
                           ~~~~~~~~~~ ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:157:36: warning: The right 
operand of '*' is a garbage value 
[clang-analyzer-core.UndefinedBinaryOperatorResult]
                   cval /= last_timing_rate_mhz * 2 * temp[0][0];
                                                    ^ ~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:118:34: note: Assuming 'type' 
is not equal to PERIODIC_TRAINING_UPDATE
           bool periodic_training_update = type == PERIODIC_TRAINING_UPDATE;
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:123:21: note: Assuming 'type' 
is not equal to DVFS_UPDATE
           bool dvfs_update = type == DVFS_UPDATE;
                              ^~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:125:18: note: Assuming 'type' 
is equal to DVFS_PT1
           bool dvfs_pt1 = type == DVFS_PT1;
                           ^~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:133:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1 || periodic_training_update) {
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:133:15: note: Left side of 
'||' is true
           if (dvfs_pt1 || periodic_training_update) {
                        ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:136:15: note: Assuming 'i' is 
>= field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:136:3: note: Loop condition is 
false. Execution continues on line 145
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:147:15: note: Assuming 'i' is 
>= field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:147:3: note: Loop condition is 
false. Execution continues on line 154
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:154:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1 || periodic_training_update) {
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:154:15: note: Left side of 
'||' is true
           if (dvfs_pt1 || periodic_training_update) {
                        ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:157:36: note: The right 
operand of '*' is a garbage value
                   cval /= last_timing_rate_mhz * 2 * temp[0][0];
                                                    ^ ~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:283:15: warning: The left 
expression of the compound assignment is an uninitialized value. The computed 
value will also be garbage [clang-analyzer-core.uninitialized.Assign]
                           temp[i][0] |= (value & 0x00ff) >> 0;
                           ~~~~~~~~~~ ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:118:34: note: Assuming 'type' 
is not equal to PERIODIC_TRAINING_UPDATE
           bool periodic_training_update = type == PERIODIC_TRAINING_UPDATE;
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:123:21: note: Assuming 'type' 
is not equal to DVFS_UPDATE
           bool dvfs_update = type == DVFS_UPDATE;
                              ^~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:125:18: note: Assuming 'type' 
is equal to DVFS_PT1
           bool dvfs_pt1 = type == DVFS_PT1;
                           ^~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:133:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1 || periodic_training_update) {
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:133:15: note: Left side of 
'||' is true
           if (dvfs_pt1 || periodic_training_update) {
                        ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:136:15: note: Assuming 'i' is 
< field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:136:3: note: Loop condition is 
true.  Entering loop body
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:136:15: note: Assuming 'i' is 
>= field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:136:3: note: Loop condition is 
false. Execution continues on line 145
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:147:15: note: Assuming 'i' is 
>= field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:147:3: note: Loop condition is 
false. Execution continues on line 154
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:154:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1 || periodic_training_update) {
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:154:15: note: Left side of 
'||' is true
           if (dvfs_pt1 || periodic_training_update) {
                        ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:160:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1)
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:160:2: note: Taking true branch
           if (dvfs_pt1)
           ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:167:6: note: 'dvfs_update' is 
false
           if (dvfs_update || periodic_training_update) {
               ^~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:167:6: note: Left side of '||' 
is false
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:167:21: note: 
'periodic_training_update' is false
           if (dvfs_update || periodic_training_update) {
                              ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:167:2: note: Taking false 
branch
           if (dvfs_update || periodic_training_update) {
           ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:179:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1 || periodic_training_update) {
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:179:15: note: Left side of 
'||' is true
           if (dvfs_pt1 || periodic_training_update) {
                        ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:185:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1)
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:185:2: note: Taking true branch
           if (dvfs_pt1)
           ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:192:6: note: 'dvfs_update' is 
false
           if (dvfs_update || periodic_training_update) {
               ^~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:192:6: note: Left side of '||' 
is false
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:192:21: note: 
'periodic_training_update' is false
           if (dvfs_update || periodic_training_update) {
                              ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:192:2: note: Taking false 
branch
           if (dvfs_update || periodic_training_update) {
           ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:206:11: note: Field 
'num_channels' is <= 1
           if (emc->num_channels > 1) {
                    ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:206:2: note: Taking false 
branch
           if (emc->num_channels > 1) {
           ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:262:6: note: Assuming field 
'num_devices' is >= 2
           if (emc->num_devices < 2)
               ^~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:262:2: note: Taking false 
branch
           if (emc->num_devices < 2)
           ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:268:6: note: 'dvfs_pt1' is true
           if (dvfs_pt1 || periodic_training_update) {
               ^~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:268:15: note: Left side of 
'||' is true
           if (dvfs_pt1 || periodic_training_update) {
                        ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:271:15: note: Assuming 'i' is 
>= field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:271:3: note: Loop condition is 
false. Execution continues on line 280
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:282:15: note: Assuming 'i' is 
< field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:282:3: note: Loop condition is 
true.  Entering loop body
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:282:15: note: Assuming 'i' is 
< field 'num_channels'
                   for (i = 0; i < emc->num_channels; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:282:3: note: Loop condition is 
true.  Entering loop body
                   for (i = 0; i < emc->num_channels; i++) {
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:283:15: note: The left 
expression of the compound assignment is an uninitialized value. The computed 
value will also be garbage
                           temp[i][0] |= (value & 0x00ff) >> 0;
                           ~~~~~~~~~~ ^
>> drivers/memory/tegra/tegra210-emc-cc-r21021.c:456:5: warning: Value stored 
>> to 'adel' is never read [clang-analyzer-deadcode.DeadStores]
                                   adel = update_clock_tree_delay(emc, 
DVFS_PT1);
                                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:456:5: note: Value stored to 
'adel' is never read
                                   adel = update_clock_tree_delay(emc, 
DVFS_PT1);
                                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/memory/tegra/tegra210-emc-cc-r21021.c:500:3: warning: Value stored 
>> to 'value' is never read [clang-analyzer-deadcode.DeadStores]
                   value = emc_readl(emc, EMC_DBG);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:500:3: note: Value stored to 
'value' is never read
                   value = emc_readl(emc, EMC_DBG);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/memory/tegra/tegra210-emc-cc-r21021.c:875:3: warning: Value stored 
>> to 'zq_wait_long' is never read [clang-analyzer-deadcode.DeadStores]
                   zq_wait_long = max((u32)1, div_o3(1000000, dst_clk_period));
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:875:3: note: Value stored to 
'zq_wait_long' is never read
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:877:3: warning: Value stored 
to 'zq_wait_long' is never read [clang-analyzer-deadcode.DeadStores]
                   zq_wait_long = max(next->min_mrs_wait,
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:877:3: note: Value stored to 
'zq_wait_long' is never read
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:880:3: warning: Value stored 
to 'zq_wait_long' is never read [clang-analyzer-deadcode.DeadStores]
                   zq_wait_long = max((u32)256,
                   ^
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:880:3: note: Value stored to 
'zq_wait_long' is never read
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:883:3: warning: Value stored 
to 'zq_wait_long' is never read [clang-analyzer-deadcode.DeadStores]
                   zq_wait_long = 0;
                   ^              ~
   drivers/memory/tegra/tegra210-emc-cc-r21021.c:883:3: note: Value stored to 
'zq_wait_long' is never read
                   zq_wait_long = 0;
                   ^              ~
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   18 warnings generated.
   include/linux/list.h:135:13: warning: Use of memory after it is freed 
[clang-analyzer-unix.Malloc]
           __list_del(entry->prev, entry->next);
                      ^
   fs/btrfs/qgroup.c:1549:6: note: Assuming field 'quota_root' is non-null
           if (!fs_info->quota_root) {
               ^~~~~~~~~~~~~~~~~~~~
   fs/btrfs/qgroup.c:1549:2: note: Taking false branch
           if (!fs_info->quota_root) {
           ^
   fs/btrfs/qgroup.c:1555:6: note: Assuming 'qgroup' is non-null
           if (!qgroup) {
               ^~~~~~~
   fs/btrfs/qgroup.c:1555:2: note: Taking false branch
           if (!qgroup) {
           ^
   fs/btrfs/qgroup.c:1561:6: note: Assuming the condition is false
           if (!list_empty(&qgroup->members)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/qgroup.c:1561:2: note: Taking false branch
           if (!list_empty(&qgroup->members)) {
           ^
   fs/btrfs/qgroup.c:1567:6: note: 'ret' is not equal to 0
           if (ret && ret != -ENOENT)
               ^~~
   fs/btrfs/qgroup.c:1567:6: note: Left side of '&&' is true
   fs/btrfs/qgroup.c:1567:13: note: Assuming the condition is false
           if (ret && ret != -ENOENT)
                      ^~~~~~~~~~~~~~
   fs/btrfs/qgroup.c:1567:2: note: Taking false branch
           if (ret && ret != -ENOENT)
           ^
   fs/btrfs/qgroup.c:1570:2: note: Loop condition is false. Execution continues 
on line 1579
           while (!list_empty(&qgroup->groups)) {
           ^
   fs/btrfs/qgroup.c:1580:2: note: Calling 'del_qgroup_rb'
           del_qgroup_rb(fs_info, qgroupid);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/qgroup.c:253:6: note: Assuming 'qgroup' is non-null
           if (!qgroup)
               ^~~~~~~
   fs/btrfs/qgroup.c:253:2: note: Taking false branch
           if (!qgroup)
           ^
   fs/btrfs/qgroup.c:257:2: note: Calling '__del_qgroup_rb'
           __del_qgroup_rb(fs_info, qgroup);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/qgroup.c:231:2: note: Loop condition is true.  Entering loop body
           while (!list_empty(&qgroup->groups)) {
           ^
   fs/btrfs/qgroup.c:232:10: note: Left side of '&&' is false
                   list = list_first_entry(&qgroup->groups,
                          ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:704:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   fs/btrfs/qgroup.c:232:10: note: Taking false branch
                   list = list_first_entry(&qgroup->groups,
                          ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:704:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:328:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)

vim +/mpc_req +936 drivers/memory/tegra/tegra210-emc-core.c

10de21148f7d28 Joseph Lo 2019-05-29  930  
10de21148f7d28 Joseph Lo 2019-05-29  931  void 
tegra210_emc_start_periodic_compensation(struct tegra210_emc *emc)
10de21148f7d28 Joseph Lo 2019-05-29  932  {
10de21148f7d28 Joseph Lo 2019-05-29  933        u32 mpc_req = 0x4b;
10de21148f7d28 Joseph Lo 2019-05-29  934  
10de21148f7d28 Joseph Lo 2019-05-29  935        emc_writel(emc, mpc_req, 
EMC_MPC);
10de21148f7d28 Joseph Lo 2019-05-29 @936        mpc_req = emc_readl(emc, 
EMC_MPC);
10de21148f7d28 Joseph Lo 2019-05-29  937  }
10de21148f7d28 Joseph Lo 2019-05-29  938  

:::::: The code at line 936 was first introduced by commit
:::::: 10de21148f7d28c9e918aaee7cede74a7d506e24 memory: tegra: Add EMC scaling 
support code for Tegra210

:::::: TO: Joseph Lo <[email protected]>
:::::: CC: Thierry Reding <[email protected]>

---
0-DAY CI Kernel Test Service
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