All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2021-11-26  1:07 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-26  1:07 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 28747 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Robert Foss <robert.foss@linaro.org>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Hans Verkuil <hverkuil@xs4all.nl>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ced7ca3570333998ad2088d5a6275701970e28e
commit: 2fa698e3da84edc6b7a2d670f8bd5035891a744e media: camss: vfe: Decrease priority of of VFE HW version to 'dbg'
date:   8 weeks ago
:::::: branch date: 6 hours ago
:::::: commit date: 8 weeks ago
config: arm-randconfig-c002-20211122 (https://download.01.org/0day-ci/archive/20211126/202111260853.hscNWcks-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c133fb321f7ca6083ce15b6aa5bf89de6600e649)
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=2fa698e3da84edc6b7a2d670f8bd5035891a744e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2fa698e3da84edc6b7a2d670f8bd5035891a744e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   drivers/dma/nbpfaxi.c:1339:3: note: Taking false branch
                   if (!irq_res)
                   ^
   drivers/dma/nbpfaxi.c:1342:30: note: Assuming 'irq' is <= field 'end'
                   for (irq = irq_res->start; irq <= irq_res->end;
                                              ^~~~~~~~~~~~~~~~~~~
   drivers/dma/nbpfaxi.c:1342:3: note: Loop condition is true.  Entering loop body
                   for (irq = irq_res->start; irq <= irq_res->end;
                   ^
   drivers/dma/nbpfaxi.c:1342:30: note: Assuming 'irq' is <= field 'end'
                   for (irq = irq_res->start; irq <= irq_res->end;
                                              ^~~~~~~~~~~~~~~~~~~
   drivers/dma/nbpfaxi.c:1342:3: note: Loop condition is true.  Entering loop body
                   for (irq = irq_res->start; irq <= irq_res->end;
                   ^
   drivers/dma/nbpfaxi.c:1342:30: note: Assuming 'irq' is > field 'end'
                   for (irq = irq_res->start; irq <= irq_res->end;
                                              ^~~~~~~~~~~~~~~~~~~
   drivers/dma/nbpfaxi.c:1342:3: note: Loop condition is false. Execution continues on line 1337
                   for (irq = irq_res->start; irq <= irq_res->end;
                   ^
   drivers/dma/nbpfaxi.c:1337:2: note: Loop condition is true.  Entering loop body
           for (i = 0; irqs < ARRAY_SIZE(irqbuf); i++) {
           ^
   drivers/dma/nbpfaxi.c:1339:7: note: Assuming 'irq_res' is null
                   if (!irq_res)
                       ^~~~~~~~
   drivers/dma/nbpfaxi.c:1339:3: note: Taking true branch
                   if (!irq_res)
                   ^
   drivers/dma/nbpfaxi.c:1340:4: note:  Execution continues on line 1353
                           break;
                           ^
   drivers/dma/nbpfaxi.c:1353:6: note: 'irqs' is not equal to 1
           if (irqs != 1 && irqs != 2 && irqs != num_channels + 1)
               ^~~~
   drivers/dma/nbpfaxi.c:1353:6: note: Left side of '&&' is true
   drivers/dma/nbpfaxi.c:1353:19: note: 'irqs' is equal to 2
           if (irqs != 1 && irqs != 2 && irqs != num_channels + 1)
                            ^~~~
   drivers/dma/nbpfaxi.c:1353:29: note: Left side of '&&' is false
           if (irqs != 1 && irqs != 2 && irqs != num_channels + 1)
                                      ^
   drivers/dma/nbpfaxi.c:1356:6: note: 'irqs' is not equal to 1
           if (irqs == 1) {
               ^~~~
   drivers/dma/nbpfaxi.c:1356:2: note: Taking false branch
           if (irqs == 1) {
           ^
   drivers/dma/nbpfaxi.c:1363:7: note: Assuming 'eirq' is >= 0
                   if (eirq < 0)
                       ^~~~~~~~
   drivers/dma/nbpfaxi.c:1363:3: note: Taking false branch
                   if (eirq < 0)
                   ^
   drivers/dma/nbpfaxi.c:1366:7: note: Assuming the condition is true
                   if (irqs == num_channels + 1) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/dma/nbpfaxi.c:1366:3: note: Taking true branch
                   if (irqs == num_channels + 1) {
                   ^
   drivers/dma/nbpfaxi.c:1369:4: note: Loop condition is true.  Entering loop body
                           for (i = 0, chan = nbpf->chan; i <= num_channels;
                           ^
   drivers/dma/nbpfaxi.c:1372:9: note: Assuming the condition is false
                                   if (irqbuf[i] == eirq)
                                       ^~~~~~~~~~~~~~~~~
   drivers/dma/nbpfaxi.c:1372:5: note: Taking false branch
                                   if (irqbuf[i] == eirq)
                                   ^
   drivers/dma/nbpfaxi.c:1369:4: note: Loop condition is true.  Entering loop body
                           for (i = 0, chan = nbpf->chan; i <= num_channels;
                           ^
   drivers/dma/nbpfaxi.c:1372:9: note: Assuming the condition is true
                                   if (irqbuf[i] == eirq)
                                       ^~~~~~~~~~~~~~~~~
   drivers/dma/nbpfaxi.c:1372:5: note: Taking true branch
                                   if (irqbuf[i] == eirq)
                                   ^
   drivers/dma/nbpfaxi.c:1373:6: note: The value 2 is assigned to 'i'
                                           i++;
                                           ^~~
   drivers/dma/nbpfaxi.c:1374:15: note: Assigned value is garbage or undefined
                                   chan->irq = irqbuf[i];
                                             ^ ~~~~~~~~~
   1 warning generated.
   drivers/gpu/drm/panel/panel-elida-kd35t133.c:65:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = ctx->dev;
                          ^~~   ~~~~~~~~
   drivers/gpu/drm/panel/panel-elida-kd35t133.c:65:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = ctx->dev;
                          ^~~   ~~~~~~~~
   1 warning generated.
   drivers/gpu/drm/panel/panel-innolux-p079zca.c:459:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = PTR_ERR(innolux->enable_gpio);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/panel/panel-innolux-p079zca.c:459:3: note: Value stored to 'err' is never read
                   err = PTR_ERR(innolux->enable_gpio);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   5 warnings generated.
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: note: Value stored to 'gen' during its initialization is never read
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: warning: Value stored to 'rev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: note: Value stored to 'rev' during its initialization is never read
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: warning: Value stored to 'step' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: note: Value stored to 'step' during its initialization is never read
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: warning: Value stored to 'violation' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: note: Value stored to 'violation' during its initialization is never read
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   include/media/v4l2-subdev.h:1000:10: warning: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state') [clang-analyzer-core.NullDereference]
           return &state->pads[pad].try_fmt;
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:14: note: Assuming 'i' is < field 'line_num'
           for (i = 0; i < vfe->line_num; i++) {
                       ^~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < vfe->line_num; i++) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:7: note: 'i' is not equal to VFE_LINE_PIX
                   if (i == VFE_LINE_PIX)
                       ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: Taking false branch
                   if (i == VFE_LINE_PIX)
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1550:9: note: Calling 'vfe_init_formats'
                   ret = vfe_init_formats(sd, NULL);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: 'fh' is null
                   .which = fh ? V4L2_SUBDEV_FORMAT_TRY :
                            ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: 'fh' is null
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: Passing null pointer value via 2nd parameter 'sd_state'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:9: note: Calling 'vfe_set_format'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:6: note: 'format' is not equal to NULL
           if (format == NULL)
               ^~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:2: note: Taking false branch
           if (format == NULL)
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1080:6: note: Assuming field 'pad' is equal to MSM_VFE_PAD_SINK
           if (fmt->pad == MSM_VFE_PAD_SINK) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1080:2: note: Taking true branch
           if (fmt->pad == MSM_VFE_PAD_SINK) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1085:35: note: Passing null pointer value via 2nd parameter 'sd_state'
                   format = __vfe_get_format(line, sd_state, MSM_VFE_PAD_SRC,
                                                   ^~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1085:12: note: Calling '__vfe_get_format'
                   format = __vfe_get_format(line, sd_state, MSM_VFE_PAD_SRC,
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:768:6: note: Assuming 'which' is equal to V4L2_SUBDEV_FORMAT_TRY
           if (which == V4L2_SUBDEV_FORMAT_TRY)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:768:2: note: Taking true branch
           if (which == V4L2_SUBDEV_FORMAT_TRY)
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:769:52: note: Passing null pointer value via 2nd parameter 'state'
                   return v4l2_subdev_get_try_format(&line->subdev, sd_state,
                                                                    ^~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:769:10: note: Calling 'v4l2_subdev_get_try_format'
                   return v4l2_subdev_get_try_format(&line->subdev, sd_state,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/media/v4l2-subdev.h:998:14: note: Assuming 'pad' is < field 'num_pads'
           if (WARN_ON(pad >= sd->entity.num_pads))
                       ^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   include/media/v4l2-subdev.h:998:6: note: Taking false branch
           if (WARN_ON(pad >= sd->entity.num_pads))
               ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   include/media/v4l2-subdev.h:998:2: note: Taking false branch
           if (WARN_ON(pad >= sd->entity.num_pads))
           ^
   include/media/v4l2-subdev.h:1000:10: note: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state')
           return &state->pads[pad].try_fmt;
                   ^~~~~
   1 warning generated.
   drivers/regulator/bcm590xx-regulator.c:140:8: warning: Excessive padding in 'struct bcm590xx_info' (6 padding bytes, where 2 is optimal). 
   Optimal fields order: 
   name, 
   vin_name, 
   volt_table, 
   linear_ranges, 
--
           ^
   fs/overlayfs/export.c:813:6: note: Assuming 'err' is 0
           if (err)
               ^~~
   fs/overlayfs/export.c:813:2: note: Taking false branch
           if (err)
           ^
   fs/overlayfs/export.c:817:12: note: Assuming the condition is false
           dentry = (flags & OVL_FH_FLAG_PATH_UPPER) ?
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/overlayfs/export.c:817:11: note: '?' condition is false
           dentry = (flags & OVL_FH_FLAG_PATH_UPPER) ?
                    ^
   fs/overlayfs/export.c:819:4: note: Calling 'ovl_lower_fh_to_d'
                    ovl_lower_fh_to_d(sb, fh);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/overlayfs/export.c:708:6: note: Assuming 'err' is 0
           if (err)
               ^~~
   fs/overlayfs/export.c:708:2: note: Taking false branch
           if (err)
           ^
   fs/overlayfs/export.c:711:6: note: Left side of '||' is false
           if (!d_is_dir(origin.dentry) ||
               ^
   fs/overlayfs/export.c:712:6: note: Assuming the condition is false
               !(origin.dentry->d_flags & DCACHE_DISCONNECTED)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/overlayfs/export.c:711:2: note: Taking false branch
           if (!d_is_dir(origin.dentry) ||
           ^
   fs/overlayfs/export.c:726:6: note: Assuming field 'indexdir' is null
           if (ofs->indexdir) {
               ^~~~~~~~~~~~~
   fs/overlayfs/export.c:726:2: note: Taking false branch
           if (ofs->indexdir) {
           ^
   fs/overlayfs/export.c:736:6: note: 'index' is null
           if (index && d_is_dir(index)) {
               ^~~~~
   fs/overlayfs/export.c:736:12: note: Left side of '&&' is false
           if (index && d_is_dir(index)) {
                     ^
   fs/overlayfs/export.c:749:2: note: Taking true branch
           if (d_is_dir(origin.dentry)) {
           ^
   fs/overlayfs/export.c:753:7: note: Assuming 'err' is 0
                   if (err)
                       ^~~
   fs/overlayfs/export.c:753:3: note: Taking false branch
                   if (err)
                   ^
   fs/overlayfs/export.c:756:6: note: 'index' is null
           if (index) {
               ^~~~~
   fs/overlayfs/export.c:756:2: note: Taking false branch
           if (index) {
           ^
   fs/overlayfs/export.c:763:11: note: Calling 'ovl_get_dentry'
           dentry = ovl_get_dentry(sb, NULL, &origin, index);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/overlayfs/export.c:654:34: note: 'upper' is null
           const struct ovl_layer *layer = upper ? &ofs->layers[0] : lowerpath->layer;
                                           ^~~~~
   fs/overlayfs/export.c:654:34: note: '?' condition is false
   fs/overlayfs/export.c:655:24: note: '?' condition is false
           struct dentry *real = upper ?: (index ?: lowerpath->dentry);
                                 ^
   fs/overlayfs/export.c:655:34: note: '?' condition is false
           struct dentry *real = upper ?: (index ?: lowerpath->dentry);
                                           ^
   fs/overlayfs/export.c:655:2: note: 'real' initialized to a null pointer value
           struct dentry *real = upper ?: (index ?: lowerpath->dentry);
           ^~~~~~~~~~~~~~~~~~~
   fs/overlayfs/export.c:661:16: note: Passing null pointer value via 1st parameter 'dentry'
           if (!d_is_dir(real))
                         ^~~~
   fs/overlayfs/export.c:661:7: note: Calling 'd_is_dir'
           if (!d_is_dir(real))
                ^~~~~~~~~~~~~~
   include/linux/dcache.h:420:22: note: Passing null pointer value via 1st parameter 'dentry'
           return d_can_lookup(dentry) || d_is_autodir(dentry);
                               ^~~~~~
   include/linux/dcache.h:420:9: note: Calling 'd_can_lookup'
           return d_can_lookup(dentry) || d_is_autodir(dentry);
                  ^~~~~~~~~~~~~~~~~~~~
   include/linux/dcache.h:410:24: note: Passing null pointer value via 1st parameter 'dentry'
           return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE;
                                 ^~~~~~
   include/linux/dcache.h:410:9: note: Calling '__d_entry_type'
           return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE;
                  ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dcache.h:395:9: note: Access to field 'd_flags' results in a dereference of a null pointer (loaded from variable 'dentry')
           return dentry->d_flags & DCACHE_ENTRY_TYPE;
                  ^~~~~~
   Suppressed 2 warnings (2 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 with check filters).
   5 warnings generated.
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: note: Value stored to 'gen' during its initialization is never read
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: warning: Value stored to 'rev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: note: Value stored to 'rev' during its initialization is never read
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: warning: Value stored to 'step' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: note: Value stored to 'step' during its initialization is never read
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: warning: Value stored to 'violation' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: note: Value stored to 'violation' during its initialization is never read
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   include/media/v4l2-subdev.h:1000:10: warning: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state') [clang-analyzer-core.NullDereference]
           return &state->pads[pad].try_fmt;
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:14: note: Assuming 'i' is < field 'line_num'
           for (i = 0; i < vfe->line_num; i++) {
                       ^~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < vfe->line_num; i++) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:7: note: 'i' is not equal to VFE_LINE_PIX
                   if (i == VFE_LINE_PIX)
                       ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: Taking false branch
                   if (i == VFE_LINE_PIX)
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1550:9: note: Calling 'vfe_init_formats'
                   ret = vfe_init_formats(sd, NULL);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: 'fh' is null
                   .which = fh ? V4L2_SUBDEV_FORMAT_TRY :
                            ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: 'fh' is null
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: Passing null pointer value via 2nd parameter 'sd_state'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:9: note: Calling 'vfe_set_format'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:6: note: 'format' is not equal to NULL
           if (format == NULL)
               ^~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:2: note: Taking false branch
           if (format == NULL)
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1080:6: note: Assuming field 'pad' is equal to MSM_VFE_PAD_SINK
           if (fmt->pad == MSM_VFE_PAD_SINK) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1080:2: note: Taking true branch
           if (fmt->pad == MSM_VFE_PAD_SINK) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1085:35: note: Passing null pointer value via 2nd parameter 'sd_state'
                   format = __vfe_get_format(line, sd_state, MSM_VFE_PAD_SRC,
                                                   ^~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1085:12: note: Calling '__vfe_get_format'
                   format = __vfe_get_format(line, sd_state, MSM_VFE_PAD_SRC,
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:768:6: note: Assuming 'which' is equal to V4L2_SUBDEV_FORMAT_TRY
           if (which == V4L2_SUBDEV_FORMAT_TRY)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:768:2: note: Taking true branch
           if (which == V4L2_SUBDEV_FORMAT_TRY)
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:769:52: note: Passing null pointer value via 2nd parameter 'state'
                   return v4l2_subdev_get_try_format(&line->subdev, sd_state,
                                                                    ^~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:769:10: note: Calling 'v4l2_subdev_get_try_format'
                   return v4l2_subdev_get_try_format(&line->subdev, sd_state,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/media/v4l2-subdev.h:998:14: note: Assuming 'pad' is < field 'num_pads'
           if (WARN_ON(pad >= sd->entity.num_pads))
                       ^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   include/media/v4l2-subdev.h:998:6: note: Taking false branch
           if (WARN_ON(pad >= sd->entity.num_pads))
               ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   include/media/v4l2-subdev.h:998:2: note: Taking false branch
           if (WARN_ON(pad >= sd->entity.num_pads))
           ^
   include/media/v4l2-subdev.h:1000:10: note: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state')
           return &state->pads[pad].try_fmt;
                   ^~~~~
   3 warnings generated.
   drivers/media/dvb-core/dvb_frontend.c:253:8: warning: Access to field 'eventw' results in a dereference of a null pointer (loaded from variable 'events') [clang-analyzer-core.NullDereference]
           wp = (events->eventw + 1) % MAX_EVENT;
                 ^
   drivers/media/dvb-core/dvb_frontend.c:660:2: note: Taking false branch
           dev_dbg(fe->dvb->device, "%s:\n", __func__);
           ^

vim +/gen +184 drivers/media/platform/qcom/camss/camss-vfe-170.c

7319cdf189bb643 Robert Foss 2021-03-16  179  
7319cdf189bb643 Robert Foss 2021-03-16  180  static void vfe_hw_version_read(struct vfe_device *vfe, struct device *dev)
7319cdf189bb643 Robert Foss 2021-03-16  181  {
7319cdf189bb643 Robert Foss 2021-03-16  182  	u32 hw_version = readl_relaxed(vfe->base + VFE_HW_VERSION);
7319cdf189bb643 Robert Foss 2021-03-16  183  
7319cdf189bb643 Robert Foss 2021-03-16 @184  	u32 gen = (hw_version >> 28) & 0xF;
7319cdf189bb643 Robert Foss 2021-03-16 @185  	u32 rev = (hw_version >> 16) & 0xFFF;
7319cdf189bb643 Robert Foss 2021-03-16 @186  	u32 step = hw_version & 0xFFFF;
7319cdf189bb643 Robert Foss 2021-03-16  187  
2fa698e3da84edc Robert Foss 2021-07-26  188  	dev_dbg(dev, "VFE HW Version = %u.%u.%u\n", gen, rev, step);
7319cdf189bb643 Robert Foss 2021-03-16  189  }
7319cdf189bb643 Robert Foss 2021-03-16  190  

:::::: The code at line 184 was first introduced by commit
:::::: 7319cdf189bb643c6d56e5898ef89ad7c3ef6c31 media: camss: Add support for VFE hardware version Titan 170

:::::: TO: Robert Foss <robert.foss@linaro.org>
:::::: CC: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-04-30  6:53 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-04-30  6:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 15758 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Robert Foss <robert.foss@linaro.org>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Hans Verkuil <hverkuil@xs4all.nl>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8013d1d3d2e33236dee13a133fba49ad55045e79
commit: 2fa698e3da84edc6b7a2d670f8bd5035891a744e media: camss: vfe: Decrease priority of of VFE HW version to 'dbg'
date:   7 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 7 months ago
config: arm-randconfig-c002-20220427 (https://download.01.org/0day-ci/archive/20220430/202204301419.9fO2Gnds-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 1cddcfdc3c683b393df1a5c9063252eb60e52818)
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=2fa698e3da84edc6b7a2d670f8bd5035891a744e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2fa698e3da84edc6b7a2d670f8bd5035891a744e
        # 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 as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   fs/btrfs/volumes.c:6702:6: note: Assuming 'ret' is 0
           if (ret) {
               ^~~
   fs/btrfs/volumes.c:6702:2: note: Taking false branch
           if (ret) {
           ^
   fs/btrfs/volumes.c:6714:7: note: Assuming the condition is false
           if ((bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) &&
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6714:55: note: Left side of '&&' is false
           if ((bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) &&
                                                                ^
   fs/btrfs/volumes.c:6730:6: note: Assuming 'map_length' is >= 'length'
           if (map_length < length) {
               ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6730:2: note: Taking false branch
           if (map_length < length) {
           ^
   fs/btrfs/volumes.c:6737:19: note: Assuming 'dev_nr' is < 'total_devs'
           for (dev_nr = 0; dev_nr < total_devs; dev_nr++) {
                            ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6737:2: note: Loop condition is true.  Entering loop body
           for (dev_nr = 0; dev_nr < total_devs; dev_nr++) {
           ^
   fs/btrfs/volumes.c:6739:7: note: Assuming 'dev' is null
                   if (!dev || !dev->bdev || test_bit(BTRFS_DEV_STATE_MISSING,
                       ^~~~
   fs/btrfs/volumes.c:6739:12: note: Left side of '||' is true
                   if (!dev || !dev->bdev || test_bit(BTRFS_DEV_STATE_MISSING,
                            ^
   fs/btrfs/volumes.c:6743:4: note: Calling 'bbio_error'
                           bbio_error(bbio, first_bio, logical);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6669:2: note: Taking true branch
           if (atomic_dec_and_test(&bbio->stripes_pending)) {
           ^
   fs/btrfs/volumes.c:6671:11: note: Assuming 'bio' is equal to field 'orig_bio'
                   WARN_ON(bio != bbio->orig_bio);
                           ^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   fs/btrfs/volumes.c:6671:3: note: Taking false branch
                   WARN_ON(bio != bbio->orig_bio);
                   ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   fs/btrfs/volumes.c:6675:7: note: Assuming the condition is false
                   if (atomic_read(&bbio->error) > bbio->max_errors)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6675:3: note: Taking false branch
                   if (atomic_read(&bbio->error) > bbio->max_errors)
                   ^
   fs/btrfs/volumes.c:6679:3: note: Calling 'btrfs_end_bbio'
                   btrfs_end_bbio(bbio, bio);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6573:2: note: Calling 'btrfs_put_bbio'
           btrfs_put_bbio(bbio);
           ^~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:5849:7: note: 'bbio' is non-null
           if (!bbio)
                ^~~~
   fs/btrfs/volumes.c:5849:2: note: Taking false branch
           if (!bbio)
           ^
   fs/btrfs/volumes.c:5851:2: note: Taking true branch
           if (refcount_dec_and_test(&bbio->refs))
           ^
   fs/btrfs/volumes.c:5852:3: note: Memory is released
                   kfree(bbio);
                   ^~~~~~~~~~~
   fs/btrfs/volumes.c:6573:2: note: Returning; memory was released via 1st parameter
           btrfs_put_bbio(bbio);
           ^~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6679:3: note: Returning; memory was released via 1st parameter
                   btrfs_end_bbio(bbio, bio);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6743:4: note: Returning; memory was released via 1st parameter
                           bbio_error(bbio, first_bio, logical);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6744:4: note:  Execution continues on line 6737
                           continue;
                           ^
   fs/btrfs/volumes.c:6737:19: note: Assuming 'dev_nr' is < 'total_devs'
           for (dev_nr = 0; dev_nr < total_devs; dev_nr++) {
                            ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:6737:2: note: Loop condition is true.  Entering loop body
           for (dev_nr = 0; dev_nr < total_devs; dev_nr++) {
           ^
   fs/btrfs/volumes.c:6738:9: note: Use of memory after it is freed
                   dev = bbio->stripes[dev_nr].dev;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/volumes.c:8130:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                           ret = 0;
                           ^     ~
   fs/btrfs/volumes.c:8130:4: note: Value stored to 'ret' is never read
                           ret = 0;
                           ^     ~
   5 warnings generated.
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: note: Value stored to 'gen' during its initialization is never read
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: warning: Value stored to 'rev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: note: Value stored to 'rev' during its initialization is never read
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: warning: Value stored to 'step' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: note: Value stored to 'step' during its initialization is never read
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   Suppressed 2 warnings (2 with check filters).
   3 warnings generated.
   drivers/w1/slaves/w1_therm.c:1252:5: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                                   ret = -EIO;
                                   ^     ~~~~
   drivers/w1/slaves/w1_therm.c:1252:5: note: Value stored to 'ret' is never read
                                   ret = -EIO;
                                   ^     ~~~~
   drivers/w1/slaves/w1_therm.c:1799:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(p_args, buf);
           ^~~~~~
   drivers/w1/slaves/w1_therm.c:1799:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(p_args, buf);
           ^~~~~~
   drivers/w1/slaves/w1_therm.c:2090:22: warning: The right operand of '==' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   if (sl->reg_num.id == reg_num->id)
                                      ^  ~~~~~~~~~~~
   drivers/w1/slaves/w1_therm.c:2067:6: note: Assuming the condition is false
           if (w1_reset_bus(sl->master))
               ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/w1/slaves/w1_therm.c:2067:2: note: Taking false branch
           if (w1_reset_bus(sl->master))
           ^
   drivers/w1/slaves/w1_therm.c:2077:6: note: Assuming 'ack' is equal to W1_42_SUCCESS_CONFIRM_BYTE
           if (ack != W1_42_SUCCESS_CONFIRM_BYTE)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/w1/slaves/w1_therm.c:2077:2: note: Taking false branch
           if (ack != W1_42_SUCCESS_CONFIRM_BYTE)
           ^
   drivers/w1/slaves/w1_therm.c:2081:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i <= 64; i++) {
           ^
   drivers/w1/slaves/w1_therm.c:2082:7: note: Assuming the condition is false
                   if (w1_reset_bus(sl->master))
                       ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/w1/slaves/w1_therm.c:2082:3: note: Taking false branch
                   if (w1_reset_bus(sl->master))
                   ^
   drivers/w1/slaves/w1_therm.c:2088:7: note: Assuming field 'family' is not equal to W1_42_FINISHED_BYTE
                   if (reg_num->family == W1_42_FINISHED_BYTE)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/w1/slaves/w1_therm.c:2088:3: note: Taking false branch
                   if (reg_num->family == W1_42_FINISHED_BYTE)
                   ^
   drivers/w1/slaves/w1_therm.c:2090:22: note: The right operand of '==' is a garbage value
                   if (sl->reg_num.id == reg_num->id)
                                      ^  ~~~~~~~~~~~
   1 warning generated.
   drivers/w1/slaves/w1_ds2438.c:69:3: warning: Value stored to 'crc' is never read [clang-analyzer-deadcode.DeadStores]
                   crc = 0;
                   ^     ~
   drivers/w1/slaves/w1_ds2438.c:69:3: note: Value stored to 'crc' is never read
                   crc = 0;
                   ^     ~
   1 warning generated.
   drivers/comedi/drivers/pcmmio.c:578:2: warning: Value stored to 'val' is never read [clang-analyzer-deadcode.DeadStores]
           val |= inb(iobase + PCMMIO_AI_MSB_REG) << 8;
           ^
   drivers/comedi/drivers/pcmmio.c:578:2: note: Value stored to 'val' is never read
   1 warning generated.
   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/test-drivers/vicodec/codec-fwht.c:638:2: warning: Value stored to 'deltablock' is never read [clang-analyzer-deadcode.DeadStores]
           deltablock -= 64;
           ^             ~~
   drivers/media/test-drivers/vicodec/codec-fwht.c:638:2: note: Value stored to 'deltablock' is never read
           deltablock -= 64;
           ^             ~~
   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).
   4 warnings generated.
   drivers/media/test-drivers/vidtv/vidtv_bridge.c:123:6: warning: Value stored to 'mux_buf_sz' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 mux_buf_sz = mux_buf_sz_pkts * TS_PACKET_LEN;
               ^~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/test-drivers/vidtv/vidtv_bridge.c:123:6: note: Value stored to 'mux_buf_sz' during its initialization is never read
           u32 mux_buf_sz = mux_buf_sz_pkts * TS_PACKET_LEN;
               ^~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/test-drivers/vidtv/vidtv_bridge.c:206:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &dvb->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~
   drivers/media/test-drivers/vidtv/vidtv_bridge.c:206:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = &dvb->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~
   Suppressed 2 warnings (2 with check filters).
   1 warning generated.
   drivers/media/test-drivers/vidtv/vidtv_s302m.c:383:3: warning: Value stored to 'nbytes_per_unit' is never read [clang-analyzer-deadcode.DeadStores]
                   nbytes_per_unit = 0;
                   ^                 ~
   drivers/media/test-drivers/vidtv/vidtv_s302m.c:383:3: note: Value stored to 'nbytes_per_unit' is never read

vim +/gen +184 drivers/media/platform/qcom/camss/camss-vfe-170.c

7319cdf189bb64 Robert Foss 2021-03-16  179  
7319cdf189bb64 Robert Foss 2021-03-16  180  static void vfe_hw_version_read(struct vfe_device *vfe, struct device *dev)
7319cdf189bb64 Robert Foss 2021-03-16  181  {
7319cdf189bb64 Robert Foss 2021-03-16  182  	u32 hw_version = readl_relaxed(vfe->base + VFE_HW_VERSION);
7319cdf189bb64 Robert Foss 2021-03-16  183  
7319cdf189bb64 Robert Foss 2021-03-16 @184  	u32 gen = (hw_version >> 28) & 0xF;
7319cdf189bb64 Robert Foss 2021-03-16 @185  	u32 rev = (hw_version >> 16) & 0xFFF;
7319cdf189bb64 Robert Foss 2021-03-16 @186  	u32 step = hw_version & 0xFFFF;
7319cdf189bb64 Robert Foss 2021-03-16  187  
2fa698e3da84ed Robert Foss 2021-07-26  188  	dev_dbg(dev, "VFE HW Version = %u.%u.%u\n", gen, rev, step);
7319cdf189bb64 Robert Foss 2021-03-16  189  }
7319cdf189bb64 Robert Foss 2021-03-16  190  

:::::: The code at line 184 was first introduced by commit
:::::: 7319cdf189bb643c6d56e5898ef89ad7c3ef6c31 media: camss: Add support for VFE hardware version Titan 170

:::::: TO: Robert Foss <robert.foss@linaro.org>
:::::: CC: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-02-26 19:14 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-02-26 19:14 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 18652 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Robert Foss <robert.foss@linaro.org>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Hans Verkuil <hverkuil@xs4all.nl>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9137eda53752ef73148e42b0d7640a00f1bc96b1
commit: 2fa698e3da84edc6b7a2d670f8bd5035891a744e media: camss: vfe: Decrease priority of of VFE HW version to 'dbg'
date:   5 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 5 months ago
config: riscv-randconfig-c006-20220222 (https://download.01.org/0day-ci/archive/20220227/202202270255.uqhYewa8-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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=2fa698e3da84edc6b7a2d670f8bd5035891a744e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2fa698e3da84edc6b7a2d670f8bd5035891a744e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   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.
   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.
   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.
   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.
   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.
   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.
   10 warnings generated.
   drivers/media/test-drivers/vimc/vimc-core.c:29:8: warning: Excessive padding in 'struct vimc_ent_link' (4 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   src_ent, 
   sink_ent, 
   flags, 
   src_pad, 
   sink_pad, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct vimc_ent_link {
   ~~~~~~~^~~~~~~~~~~~~~~
   drivers/media/test-drivers/vimc/vimc-core.c:29:8: note: Excessive padding in 'struct vimc_ent_link' (4 padding bytes, where 0 is optimal). Optimal fields order: src_ent, sink_ent, flags, src_pad, sink_pad, consider reordering the fields or adding explicit padding members
   struct vimc_ent_link {
   ~~~~~~~^~~~~~~~~~~~~~~
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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/w1/slaves/w1_ds2438.c:69:3: warning: Value stored to 'crc' is never read [clang-analyzer-deadcode.DeadStores]
                   crc = 0;
                   ^     ~
   drivers/w1/slaves/w1_ds2438.c:69:3: note: Value stored to 'crc' is never read
                   crc = 0;
                   ^     ~
   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.
   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.
   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.
   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.
   9 warnings generated.
   drivers/w1/slaves/w1_ds28e17.c:723:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcat(data->adapter.name, sl->name);
           ^~~~~~
   drivers/w1/slaves/w1_ds28e17.c:723:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
           strcat(data->adapter.name, sl->name);
           ^~~~~~
   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.
   13 warnings generated.
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: note: Value stored to 'gen' during its initialization is never read
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: warning: Value stored to 'rev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: note: Value stored to 'rev' during its initialization is never read
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: warning: Value stored to 'step' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: note: Value stored to 'step' during its initialization is never read
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   Suppressed 10 warnings (9 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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   drivers/power/supply/bq256xx_charger.c:1521:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = regmap_update_bits(bq->regmap, BQ256XX_CHARGER_CONTROL_1,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/bq256xx_charger.c:1521:2: note: Value stored to 'ret' is never read
           ret = regmap_update_bits(bq->regmap, BQ256XX_CHARGER_CONTROL_1,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.

vim +/gen +184 drivers/media/platform/qcom/camss/camss-vfe-170.c

7319cdf189bb64 Robert Foss 2021-03-16  179  
7319cdf189bb64 Robert Foss 2021-03-16  180  static void vfe_hw_version_read(struct vfe_device *vfe, struct device *dev)
7319cdf189bb64 Robert Foss 2021-03-16  181  {
7319cdf189bb64 Robert Foss 2021-03-16  182  	u32 hw_version = readl_relaxed(vfe->base + VFE_HW_VERSION);
7319cdf189bb64 Robert Foss 2021-03-16  183  
7319cdf189bb64 Robert Foss 2021-03-16 @184  	u32 gen = (hw_version >> 28) & 0xF;
7319cdf189bb64 Robert Foss 2021-03-16 @185  	u32 rev = (hw_version >> 16) & 0xFFF;
7319cdf189bb64 Robert Foss 2021-03-16 @186  	u32 step = hw_version & 0xFFFF;
7319cdf189bb64 Robert Foss 2021-03-16  187  
2fa698e3da84ed Robert Foss 2021-07-26  188  	dev_dbg(dev, "VFE HW Version = %u.%u.%u\n", gen, rev, step);
7319cdf189bb64 Robert Foss 2021-03-16  189  }
7319cdf189bb64 Robert Foss 2021-03-16  190  

:::::: The code at line 184 was first introduced by commit
:::::: 7319cdf189bb643c6d56e5898ef89ad7c3ef6c31 media: camss: Add support for VFE hardware version Titan 170

:::::: TO: Robert Foss <robert.foss@linaro.org>
:::::: CC: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-02-02 18:15 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-02-02 18:15 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 17569 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Robert Foss <robert.foss@linaro.org>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Hans Verkuil <hverkuil@xs4all.nl>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9f7fb8de5d9bac17b6392a14af40baf555d9129b
commit: 2fa698e3da84edc6b7a2d670f8bd5035891a744e media: camss: vfe: Decrease priority of of VFE HW version to 'dbg'
date:   4 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 4 months ago
config: arm-randconfig-c002-20220130 (https://download.01.org/0day-ci/archive/20220203/202202030233.66Zic92f-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
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=2fa698e3da84edc6b7a2d670f8bd5035891a744e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2fa698e3da84edc6b7a2d670f8bd5035891a744e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   drivers/scsi/smartpqi/smartpqi_init.c:1519:3: note: Control jumps to line 1541
                   goto out;
                   ^
   drivers/scsi/smartpqi/smartpqi_init.c:1543:2: note: Returning value (loaded from 'rc'), which participates in a condition later
           return rc;
           ^~~~~~~~~
   drivers/scsi/smartpqi/smartpqi_init.c:1556:8: note: Returning from 'pqi_get_logical_device_info'
                   rc = pqi_get_logical_device_info(ctrl_info, device);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/smartpqi/smartpqi_init.c:1560:2: note: Returning value (loaded from 'rc'), which participates in a condition later
           return rc;
           ^~~~~~~~~
   drivers/scsi/smartpqi/smartpqi_init.c:2270:8: note: Returning from 'pqi_get_device_info'
                   rc = pqi_get_device_info(ctrl_info, device, id_phys);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/smartpqi/smartpqi_init.c:2271:7: note: Assuming the condition is false
                   if (rc == -ENOMEM) {
                       ^~~~~~~~~~~~~
   drivers/scsi/smartpqi/smartpqi_init.c:2271:3: note: Taking false branch
                   if (rc == -ENOMEM) {
                   ^
   drivers/scsi/smartpqi/smartpqi_init.c:2276:7: note: 'rc' is not equal to 0
                   if (rc) {
                       ^~
   drivers/scsi/smartpqi/smartpqi_init.c:2276:3: note: Taking true branch
                   if (rc) {
                   ^
   drivers/scsi/smartpqi/smartpqi_init.c:2277:8: note: Assuming field 'is_physical_device' is not equal to 0
                           if (device->is_physical_device)
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/smartpqi/smartpqi_init.c:2277:4: note: Taking true branch
                           if (device->is_physical_device)
                           ^
   drivers/scsi/smartpqi/smartpqi_init.c:2278:5: note: Loop condition is false.  Exiting loop
                                   dev_warn(&ctrl_info->pci_dev->dev,
                                   ^
   include/linux/dev_printk.h:146:2: note: expanded from macro 'dev_warn'
           dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/dev_printk.h:109:3: note: expanded from macro 'dev_printk_index_wrap'
                   dev_printk_index_emit(level, fmt);                      \
                   ^
   include/linux/dev_printk.h:105:2: note: expanded from macro 'dev_printk_index_emit'
           printk_index_subsys_emit("%s %s: ", level, fmt)
           ^
   include/linux/printk.h:413:2: note: expanded from macro 'printk_index_subsys_emit'
           __printk_index_emit(fmt, level, subsys_fmt_prefix)
           ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   drivers/scsi/smartpqi/smartpqi_init.c:2280:25: note: Passing null pointer value via 1st parameter 'p'
                                           get_unaligned_be64(&phys_lun_ext_entry->wwid));
                                                              ^
   include/linux/dev_printk.h:146:70: note: expanded from macro 'dev_warn'
           dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
                                                                               ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
                   _p_func(dev, fmt, ##__VA_ARGS__);                       \
                                       ^~~~~~~~~~~
   drivers/scsi/smartpqi/smartpqi_init.c:2280:6: note: Calling 'get_unaligned_be64'
                                           get_unaligned_be64(&phys_lun_ext_entry->wwid));
                                           ^
   include/linux/dev_printk.h:146:70: note: expanded from macro 'dev_warn'
           dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
                                                                               ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
                   _p_func(dev, fmt, ##__VA_ARGS__);                       \
                                       ^~~~~~~~~~~
   include/asm-generic/unaligned.h:67:21: note: '__pptr' initialized to a null pointer value
           return be64_to_cpu(__get_unaligned_t(__be64, p));
                              ^
   include/asm-generic/unaligned.h:13:37: note: expanded from macro '__get_unaligned_t'
           const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);      \
                                              ^~~~~~
   include/uapi/linux/byteorder/little_endian.h:38:59: note: expanded from macro '__be64_to_cpu'
   #define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
                                                             ^
   include/uapi/linux/swab.h:128:54: note: expanded from macro '__swab64'
   #define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
                                                        ^
   include/asm-generic/unaligned.h:67:21: note: Access to field 'x' results in a dereference of a null pointer (loaded from variable '__pptr')
           return be64_to_cpu(__get_unaligned_t(__be64, p));
                              ^
   include/asm-generic/unaligned.h:14:2: note: expanded from macro '__get_unaligned_t'
           __pptr->x;                                                              \
           ^~~~~~
   include/uapi/linux/byteorder/little_endian.h:38:59: note: expanded from macro '__be64_to_cpu'
   #define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
                                                             ^
   include/uapi/linux/swab.h:128:54: note: expanded from macro '__swab64'
   #define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
                                                        ^
   1 warning generated.
   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.
   1 warning generated.
   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.
   7 warnings generated.
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: note: Value stored to 'gen' during its initialization is never read
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: warning: Value stored to 'rev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: note: Value stored to 'rev' during its initialization is never read
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: warning: Value stored to 'step' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: note: Value stored to 'step' during its initialization is never read
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: warning: Value stored to 'violation' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: note: Value stored to 'violation' during its initialization is never read
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   Suppressed 3 warnings (1 in non-user code, 2 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.
   2 warnings generated.
   Suppressed 2 warnings (1 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.
   include/media/v4l2-subdev.h:1000:10: warning: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state') [clang-analyzer-core.NullDereference]
           return &state->pads[pad].try_fmt;
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:14: note: Assuming 'i' is < field 'line_num'
           for (i = 0; i < vfe->line_num; i++) {
                       ^~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < vfe->line_num; i++) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:7: note: 'i' is not equal to VFE_LINE_PIX
                   if (i == VFE_LINE_PIX)
                       ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: Taking false branch
                   if (i == VFE_LINE_PIX)
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1550:9: note: Calling 'vfe_init_formats'
                   ret = vfe_init_formats(sd, NULL);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: 'fh' is null
                   .which = fh ? V4L2_SUBDEV_FORMAT_TRY :
                            ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: 'fh' is null
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: Passing null pointer value via 2nd parameter 'sd_state'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:9: note: Calling 'vfe_set_format'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:6: note: 'format' is not equal to NULL
           if (format == NULL)
               ^~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:2: note: Taking false branch
           if (format == NULL)
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1080:6: note: Assuming field 'pad' is equal to MSM_VFE_PAD_SINK
           if (fmt->pad == MSM_VFE_PAD_SINK) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1080:2: note: Taking true branch
           if (fmt->pad == MSM_VFE_PAD_SINK) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1085:35: note: Passing null pointer value via 2nd parameter 'sd_state'
                   format = __vfe_get_format(line, sd_state, MSM_VFE_PAD_SRC,
                                                   ^~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1085:12: note: Calling '__vfe_get_format'
                   format = __vfe_get_format(line, sd_state, MSM_VFE_PAD_SRC,
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:768:6: note: Assuming 'which' is equal to V4L2_SUBDEV_FORMAT_TRY
           if (which == V4L2_SUBDEV_FORMAT_TRY)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:768:2: note: Taking true branch
           if (which == V4L2_SUBDEV_FORMAT_TRY)
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:769:52: note: Passing null pointer value via 2nd parameter 'state'
                   return v4l2_subdev_get_try_format(&line->subdev, sd_state,
                                                                    ^~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:769:10: note: Calling 'v4l2_subdev_get_try_format'
                   return v4l2_subdev_get_try_format(&line->subdev, sd_state,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/media/v4l2-subdev.h:998:14: note: Assuming 'pad' is < field 'num_pads'
           if (WARN_ON(pad >= sd->entity.num_pads))
                       ^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   include/media/v4l2-subdev.h:998:6: note: Taking false branch
           if (WARN_ON(pad >= sd->entity.num_pads))
               ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   include/media/v4l2-subdev.h:998:2: note: Taking false branch
           if (WARN_ON(pad >= sd->entity.num_pads))
           ^
   include/media/v4l2-subdev.h:1000:10: note: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state')
           return &state->pads[pad].try_fmt;
                   ^~~~~
   Suppressed 2 warnings (1 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.

vim +/gen +184 drivers/media/platform/qcom/camss/camss-vfe-170.c

7319cdf189bb64 Robert Foss 2021-03-16  179  
7319cdf189bb64 Robert Foss 2021-03-16  180  static void vfe_hw_version_read(struct vfe_device *vfe, struct device *dev)
7319cdf189bb64 Robert Foss 2021-03-16  181  {
7319cdf189bb64 Robert Foss 2021-03-16  182  	u32 hw_version = readl_relaxed(vfe->base + VFE_HW_VERSION);
7319cdf189bb64 Robert Foss 2021-03-16  183  
7319cdf189bb64 Robert Foss 2021-03-16 @184  	u32 gen = (hw_version >> 28) & 0xF;
7319cdf189bb64 Robert Foss 2021-03-16 @185  	u32 rev = (hw_version >> 16) & 0xFFF;
7319cdf189bb64 Robert Foss 2021-03-16 @186  	u32 step = hw_version & 0xFFFF;
7319cdf189bb64 Robert Foss 2021-03-16  187  
2fa698e3da84ed Robert Foss 2021-07-26  188  	dev_dbg(dev, "VFE HW Version = %u.%u.%u\n", gen, rev, step);
7319cdf189bb64 Robert Foss 2021-03-16  189  }
7319cdf189bb64 Robert Foss 2021-03-16  190  

:::::: The code at line 184 was first introduced by commit
:::::: 7319cdf189bb643c6d56e5898ef89ad7c3ef6c31 media: camss: Add support for VFE hardware version Titan 170

:::::: TO: Robert Foss <robert.foss@linaro.org>
:::::: CC: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-01-19  8:01 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-01-19  8:01 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 31247 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Robert Foss <robert.foss@linaro.org>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Hans Verkuil <hverkuil@xs4all.nl>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   99613159ad749543621da8238acf1a122880144e
commit: 2fa698e3da84edc6b7a2d670f8bd5035891a744e media: camss: vfe: Decrease priority of of VFE HW version to 'dbg'
date:   4 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 4 months ago
config: riscv-randconfig-c006-20220111 (https://download.01.org/0day-ci/archive/20220119/202201191502.gKfsqKWc-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 244dd2913a43a200f5a6544d424cdc37b771028b)
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=2fa698e3da84edc6b7a2d670f8bd5035891a744e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2fa698e3da84edc6b7a2d670f8bd5035891a744e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   drivers/media/dvb-frontends/stv0297.c:64:2: note: Taking true branch
           if (state->config->stop_during_read) {
           ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   drivers/media/dvb-frontends/stv0297.c:65:7: note: Assuming the condition is false
                   if ((ret = i2c_transfer(state->i2c, &msg[0], 1)) != 1) {
                       ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   drivers/media/dvb-frontends/stv0297.c:65:3: note: '?' condition is false
                   if ((ret = i2c_transfer(state->i2c, &msg[0], 1)) != 1) {
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   drivers/media/dvb-frontends/stv0297.c:65:7: note: Assuming the condition is true
                   if ((ret = i2c_transfer(state->i2c, &msg[0], 1)) != 1) {
                       ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   drivers/media/dvb-frontends/stv0297.c:65:3: note: '?' condition is true
                   if ((ret = i2c_transfer(state->i2c, &msg[0], 1)) != 1) {
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   drivers/media/dvb-frontends/stv0297.c:65:3: note: Taking true branch
                   if ((ret = i2c_transfer(state->i2c, &msg[0], 1)) != 1) {
                   ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   drivers/media/dvb-frontends/stv0297.c:66:4: note: Loop condition is false.  Exiting loop
                           dprintk("%s: readreg error (reg == 0x%02x, ret == %i)\n", __func__, reg, ret);
                           ^
   drivers/media/dvb-frontends/stv0297.c:31:23: note: expanded from macro 'dprintk'
   #define dprintk(x...) printk(x)
                         ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   drivers/media/dvb-frontends/stv0297.c:67:4: note: Returning the value -1
                           return -1;
                           ^~~~~~~~~
   drivers/media/dvb-frontends/stv0297.c:130:10: note: Returning from 'stv0297_readreg'
                       | (stv0297_readreg(state, 0x58) << 24));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/stv0297.c:130:39: note: The result of the left shift is undefined because the left operand is negative
                       | (stv0297_readreg(state, 0x58) << 24));
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
   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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   Suppressed 2 warnings (2 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.
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: note: Value stored to 'gen' during its initialization is never read
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: warning: Value stored to 'rev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: note: Value stored to 'rev' during its initialization is never read
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: warning: Value stored to 'step' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: note: Value stored to 'step' during its initialization is never read
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: warning: Value stored to 'violation' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: note: Value stored to 'violation' during its initialization is never read
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   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.
   4 warnings generated.
   include/media/v4l2-subdev.h:1000:10: warning: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state') [clang-analyzer-core.NullDereference]
           return &state->pads[pad].try_fmt;
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:14: note: Assuming 'i' is < field 'line_num'
           for (i = 0; i < vfe->line_num; i++) {
                       ^~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < vfe->line_num; i++) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: '?' condition is false
                   if (i == VFE_LINE_PIX)
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:7: note: 'i' is not equal to VFE_LINE_PIX
                   if (i == VFE_LINE_PIX)
                       ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: '?' condition is false
                   if (i == VFE_LINE_PIX)
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: Taking false branch
                   if (i == VFE_LINE_PIX)
                   ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1550:9: note: Calling 'vfe_init_formats'
                   ret = vfe_init_formats(sd, NULL);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: 'fh' is null
                   .which = fh ? V4L2_SUBDEV_FORMAT_TRY :
                            ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: 'fh' is null
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: Passing null pointer value via 2nd parameter 'sd_state'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:9: note: Calling 'vfe_set_format'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:6: note: 'format' is not equal to null
           if (format == NULL)
               ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:2: note: '?' condition is false
           if (format == NULL)
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
--
           ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:71:7: note: Assuming the condition is true
                   if ((PAGE_SIZE << order) > size)
                       ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:71:3: note: '?' condition is false
                   if ((PAGE_SIZE << order) > size)
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:71:3: note: '?' condition is true
                   if ((PAGE_SIZE << order) > size)
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:71:3: note: Taking true branch
                   if ((PAGE_SIZE << order) > size)
                   ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:72:4: note: The value -1 is assigned to 'order'
                           order--;
                           ^~~~~~~
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:75:3: note: Loop condition is true.  Entering loop body
                   while (!pages) {
                   ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:78:4: note: Assuming 'pages' is non-null
                           if (pages)
                           ^
   include/linux/compiler.h:56:45: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:78:4: note: '?' condition is false
                           if (pages)
                           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:78:8: note: 'pages' is non-null
                           if (pages)
                               ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:78:4: note: '?' condition is true
                           if (pages)
                           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:78:4: note: Taking true branch
                           if (pages)
                           ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:79:5: note:  Execution continues on line 89
                                   break;
                                   ^
   drivers/media/common/videobuf2/videobuf2-dma-sg.c:90:22: note: The result of the left shift is undefined because the right operand is negative
                   for (i = 0; i < (1 << order); i++)
                                      ^  ~~~~~
   Suppressed 2 warnings (2 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.
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: note: Value stored to 'gen' during its initialization is never read
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: warning: Value stored to 'rev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: note: Value stored to 'rev' during its initialization is never read
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: warning: Value stored to 'step' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: note: Value stored to 'step' during its initialization is never read
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: warning: Value stored to 'violation' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:336:6: note: Value stored to 'violation' during its initialization is never read
           u32 violation = readl_relaxed(vfe->base + VFE_VIOLATION_STATUS);
               ^~~~~~~~~
   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.
   4 warnings generated.
   include/media/v4l2-subdev.h:1000:10: warning: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state') [clang-analyzer-core.NullDereference]
           return &state->pads[pad].try_fmt;
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:14: note: Assuming 'i' is < field 'line_num'
           for (i = 0; i < vfe->line_num; i++) {
                       ^~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < vfe->line_num; i++) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: '?' condition is false
                   if (i == VFE_LINE_PIX)
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:7: note: 'i' is not equal to VFE_LINE_PIX
                   if (i == VFE_LINE_PIX)
                       ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: '?' condition is false
                   if (i == VFE_LINE_PIX)
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: Taking false branch
                   if (i == VFE_LINE_PIX)
                   ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1550:9: note: Calling 'vfe_init_formats'
                   ret = vfe_init_formats(sd, NULL);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: 'fh' is null
                   .which = fh ? V4L2_SUBDEV_FORMAT_TRY :
                            ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: 'fh' is null
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: Passing null pointer value via 2nd parameter 'sd_state'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:9: note: Calling 'vfe_set_format'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:6: note: 'format' is not equal to null
           if (format == NULL)
               ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:2: note: '?' condition is false
           if (format == NULL)
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^

vim +/gen +184 drivers/media/platform/qcom/camss/camss-vfe-170.c

7319cdf189bb64 Robert Foss 2021-03-16  179  
7319cdf189bb64 Robert Foss 2021-03-16  180  static void vfe_hw_version_read(struct vfe_device *vfe, struct device *dev)
7319cdf189bb64 Robert Foss 2021-03-16  181  {
7319cdf189bb64 Robert Foss 2021-03-16  182  	u32 hw_version = readl_relaxed(vfe->base + VFE_HW_VERSION);
7319cdf189bb64 Robert Foss 2021-03-16  183  
7319cdf189bb64 Robert Foss 2021-03-16 @184  	u32 gen = (hw_version >> 28) & 0xF;
7319cdf189bb64 Robert Foss 2021-03-16 @185  	u32 rev = (hw_version >> 16) & 0xFFF;
7319cdf189bb64 Robert Foss 2021-03-16 @186  	u32 step = hw_version & 0xFFFF;
7319cdf189bb64 Robert Foss 2021-03-16  187  
2fa698e3da84ed Robert Foss 2021-07-26  188  	dev_dbg(dev, "VFE HW Version = %u.%u.%u\n", gen, rev, step);
7319cdf189bb64 Robert Foss 2021-03-16  189  }
7319cdf189bb64 Robert Foss 2021-03-16  190  

:::::: The code at line 184 was first introduced by commit
:::::: 7319cdf189bb643c6d56e5898ef89ad7c3ef6c31 media: camss: Add support for VFE hardware version Titan 170

:::::: TO: Robert Foss <robert.foss@linaro.org>
:::::: CC: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-01-03 22:12 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-01-03 22:12 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 16090 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Robert Foss <robert.foss@linaro.org>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Hans Verkuil <hverkuil@xs4all.nl>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c9e6606c7fe92b50a02ce51dda82586ebdf99b48
commit: 2fa698e3da84edc6b7a2d670f8bd5035891a744e media: camss: vfe: Decrease priority of of VFE HW version to 'dbg'
date:   3 months ago
:::::: branch date: 24 hours ago
:::::: commit date: 3 months ago
config: riscv-randconfig-c006-20211227 (https://download.01.org/0day-ci/archive/20220104/202201040644.UKhAeJ5h-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 511726c64d3b6cca66f7c54d457d586aa3129f67)
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=2fa698e3da84edc6b7a2d670f8bd5035891a744e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2fa698e3da84edc6b7a2d670f8bd5035891a744e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
               ^~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3818:2: note: Taking false branch
           if (!this->read_word)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3820:6: note: Assuming field 'write_word' is non-null
           if (!this->write_word)
               ^~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3820:2: note: Taking false branch
           if (!this->write_word)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3823:6: note: Assuming field 'command' is non-null
           if (!this->command)
               ^~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3823:2: note: Taking false branch
           if (!this->command)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3825:6: note: Assuming field 'wait' is non-null
           if (!this->wait)
               ^~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3825:2: note: Taking false branch
           if (!this->wait)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3827:6: note: Assuming field 'bbt_wait' is non-null
           if (!this->bbt_wait)
               ^~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3827:2: note: Taking false branch
           if (!this->bbt_wait)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3829:6: note: Assuming field 'unlock_all' is non-null
           if (!this->unlock_all)
               ^~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3829:2: note: Taking false branch
           if (!this->unlock_all)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3832:6: note: Assuming field 'chip_probe' is non-null
           if (!this->chip_probe)
               ^~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3832:2: note: Taking false branch
           if (!this->chip_probe)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3835:6: note: Assuming field 'read_bufferram' is non-null
           if (!this->read_bufferram)
               ^~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3835:2: note: Taking false branch
           if (!this->read_bufferram)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3837:6: note: Assuming field 'write_bufferram' is non-null
           if (!this->write_bufferram)
               ^~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3837:2: note: Taking false branch
           if (!this->write_bufferram)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3840:6: note: Assuming field 'block_markbad' is non-null
           if (!this->block_markbad)
               ^~~~~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3840:2: note: Taking false branch
           if (!this->block_markbad)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3842:6: note: Assuming field 'scan_bbt' is non-null
           if (!this->scan_bbt)
               ^~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3842:2: note: Taking false branch
           if (!this->scan_bbt)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3845:6: note: Calling 'onenand_probe'
           if (onenand_probe(mtd))
               ^~~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3696:6: note: Assuming 'ret' is 0
           if (ret)
               ^~~
   drivers/mtd/nand/onenand/onenand_base.c:3696:2: note: Taking false branch
           if (ret)
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3713:18: note: Assuming the condition is false
           if (FLEXONENAND(this)) {
                           ^
   include/linux/mtd/onenand.h:161:3: note: expanded from macro 'FLEXONENAND'
           (this->device_id & DEVICE_IS_FLEXONENAND)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3713:2: note: Taking false branch
           if (FLEXONENAND(this)) {
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3735:26: note: Assuming the condition is false
           if (ONENAND_IS_4KB_PAGE(this))
                                   ^
   include/linux/mtd/onenand.h:206:3: note: expanded from macro 'ONENAND_IS_4KB_PAGE'
           (this->options & ONENAND_HAS_4KB_PAGE)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/nand/onenand/onenand_base.c:3735:2: note: Taking false branch
           if (ONENAND_IS_4KB_PAGE(this))
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3746:2: note: Taking false branch
           if (FLEXONENAND(this))
           ^
   drivers/mtd/nand/onenand/onenand_base.c:3751:23: note: The result of the left shift is undefined due to shifting by '4294967295', which is greater or equal to the width of type 'int'
           this->page_mask = (1 << (this->erase_shift - this->page_shift)) - 1;
                                ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 12 warnings (5 in non-user code, 7 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.
   20 warnings generated.
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: note: Value stored to 'gen' during its initialization is never read
           u32 gen = (hw_version >> 28) & 0xF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: warning: Value stored to 'rev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:185:6: note: Value stored to 'rev' during its initialization is never read
           u32 rev = (hw_version >> 16) & 0xFFF;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: warning: Value stored to 'step' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe-170.c:186:6: note: Value stored to 'step' during its initialization is never read
           u32 step = hw_version & 0xFFFF;
               ^~~~   ~~~~~~~~~~~~~~~~~~~
   Suppressed 17 warnings (9 in non-user code, 8 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.
   16 warnings generated.
   Suppressed 16 warnings (9 in non-user code, 7 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.
   17 warnings generated.
   include/media/v4l2-subdev.h:1000:10: warning: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state') [clang-analyzer-core.NullDereference]
           return &state->pads[pad].try_fmt;
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:14: note: Assuming 'i' is < field 'line_num'
           for (i = 0; i < vfe->line_num; i++) {
                       ^~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1531:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < vfe->line_num; i++) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:7: note: 'i' is not equal to VFE_LINE_PIX
                   if (i == VFE_LINE_PIX)
                       ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1541:3: note: Taking false branch
                   if (i == VFE_LINE_PIX)
                   ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1550:9: note: Calling 'vfe_init_formats'
                   ret = vfe_init_formats(sd, NULL);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: 'fh' is null
                   .which = fh ? V4L2_SUBDEV_FORMAT_TRY :
                            ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1256:12: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: 'fh' is null
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: '?' condition is false
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:28: note: Passing null pointer value via 2nd parameter 'sd_state'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                                     ^~
   drivers/media/platform/qcom/camss/camss-vfe.c:1265:9: note: Calling 'vfe_set_format'
           return vfe_set_format(sd, fh ? fh->state : NULL, &format);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:6: note: 'format' is not equal to NULL
           if (format == NULL)
               ^~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1074:2: note: Taking false branch
           if (format == NULL)
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1080:6: note: Assuming field 'pad' is equal to MSM_VFE_PAD_SINK
           if (fmt->pad == MSM_VFE_PAD_SINK) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1080:2: note: Taking true branch
           if (fmt->pad == MSM_VFE_PAD_SINK) {
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:1085:35: note: Passing null pointer value via 2nd parameter 'sd_state'
                   format = __vfe_get_format(line, sd_state, MSM_VFE_PAD_SRC,
                                                   ^~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:1085:12: note: Calling '__vfe_get_format'
                   format = __vfe_get_format(line, sd_state, MSM_VFE_PAD_SRC,
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:768:6: note: Assuming 'which' is equal to V4L2_SUBDEV_FORMAT_TRY
           if (which == V4L2_SUBDEV_FORMAT_TRY)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:768:2: note: Taking true branch
           if (which == V4L2_SUBDEV_FORMAT_TRY)
           ^
   drivers/media/platform/qcom/camss/camss-vfe.c:769:52: note: Passing null pointer value via 2nd parameter 'state'
                   return v4l2_subdev_get_try_format(&line->subdev, sd_state,
                                                                    ^~~~~~~~
   drivers/media/platform/qcom/camss/camss-vfe.c:769:10: note: Calling 'v4l2_subdev_get_try_format'
                   return v4l2_subdev_get_try_format(&line->subdev, sd_state,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/media/v4l2-subdev.h:998:14: note: Assuming 'pad' is < field 'num_pads'
           if (WARN_ON(pad >= sd->entity.num_pads))
                       ^
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   include/media/v4l2-subdev.h:998:6: note: Taking false branch
           if (WARN_ON(pad >= sd->entity.num_pads))
               ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   include/media/v4l2-subdev.h:998:2: note: Taking false branch
           if (WARN_ON(pad >= sd->entity.num_pads))
           ^
   include/media/v4l2-subdev.h:1000:10: note: Access to field 'pads' results in a dereference of a null pointer (loaded from variable 'state')
           return &state->pads[pad].try_fmt;
                   ^~~~~
   Suppressed 16 warnings (9 in non-user code, 7 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.
   15 warnings generated.
   Suppressed 15 warnings (8 in non-user code, 7 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.
   15 warnings generated.
   Suppressed 15 warnings (8 in non-user code, 7 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.
   33 warnings generated.

vim +/gen +184 drivers/media/platform/qcom/camss/camss-vfe-170.c

7319cdf189bb64 Robert Foss 2021-03-16  179  
7319cdf189bb64 Robert Foss 2021-03-16  180  static void vfe_hw_version_read(struct vfe_device *vfe, struct device *dev)
7319cdf189bb64 Robert Foss 2021-03-16  181  {
7319cdf189bb64 Robert Foss 2021-03-16  182  	u32 hw_version = readl_relaxed(vfe->base + VFE_HW_VERSION);
7319cdf189bb64 Robert Foss 2021-03-16  183  
7319cdf189bb64 Robert Foss 2021-03-16 @184  	u32 gen = (hw_version >> 28) & 0xF;
7319cdf189bb64 Robert Foss 2021-03-16 @185  	u32 rev = (hw_version >> 16) & 0xFFF;
7319cdf189bb64 Robert Foss 2021-03-16 @186  	u32 step = hw_version & 0xFFFF;
7319cdf189bb64 Robert Foss 2021-03-16  187  
2fa698e3da84ed Robert Foss 2021-07-26  188  	dev_dbg(dev, "VFE HW Version = %u.%u.%u\n", gen, rev, step);
7319cdf189bb64 Robert Foss 2021-03-16  189  }
7319cdf189bb64 Robert Foss 2021-03-16  190  

:::::: The code at line 184 was first introduced by commit
:::::: 7319cdf189bb643c6d56e5898ef89ad7c3ef6c31 media: camss: Add support for VFE hardware version Titan 170

:::::: TO: Robert Foss <robert.foss@linaro.org>
:::::: CC: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-30  6:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26  1:07 drivers/media/platform/qcom/camss/camss-vfe-170.c:184:6: warning: Value stored to 'gen' during its initialization is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
2022-01-03 22:12 kernel test robot
2022-01-19  8:01 kernel test robot
2022-02-02 18:15 kernel test robot
2022-02-26 19:14 kernel test robot
2022-04-30  6:53 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.