All of lore.kernel.org
 help / color / mirror / Atom feed
* [sudeep-holla:v5.15/pcc_type3 11/14] drivers/mailbox/pcc.c:190:6: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
@ 2021-10-26 12:00 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-10-26 12:00 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Sudeep Holla <sudeep.holla@arm.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git v5.15/pcc_type3
head:   db918d7c13901646937da28423737c14528b9379
commit: 6eca3b7aff77252d2cf75ebc9c97697413e3500f [11/14] mailbox: pcc: Drop handling invalid bit-width in {read,write}_register
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: i386-randconfig-c001-20211021 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/commit/?id=6eca3b7aff77252d2cf75ebc9c97697413e3500f
        git remote add sudeep-holla https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git
        git fetch --no-tags sudeep-holla v5.15/pcc_type3
        git checkout 6eca3b7aff77252d2cf75ebc9c97697413e3500f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 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 >>)
                           VERBOSE_TOROUT_STRING("cxt.lwsa: Out of memory");
                           ^
   include/linux/torture.h:34:34: note: expanded from macro 'VERBOSE_TOROUT_STRING'
   #define VERBOSE_TOROUT_STRING(s) \
                                    ^
   kernel/locking/locktorture.c:977:4: note: Control jumps to line 1107
                           goto unwind;
                           ^
   kernel/locking/locktorture.c:1108:2: note: Calling 'lock_torture_cleanup'
           lock_torture_cleanup();
           ^~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/locktorture.c:844:6: note: Assuming the condition is false
           if (torture_cleanup_begin())
               ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/locktorture.c:844:2: note: Taking false branch
           if (torture_cleanup_begin())
           ^
   kernel/locking/locktorture.c:854:6: note: Assuming field 'lwsa' is non-null
           if (!cxt.lwsa && !cxt.lrsa)
               ^~~~~~~~~
   kernel/locking/locktorture.c:854:16: note: Left side of '&&' is false
           if (!cxt.lwsa && !cxt.lrsa)
                         ^
   kernel/locking/locktorture.c:857:6: note: Assuming 'writer_tasks' is null
           if (writer_tasks) {
               ^~~~~~~~~~~~
   kernel/locking/locktorture.c:857:2: note: Taking false branch
           if (writer_tasks) {
           ^
   kernel/locking/locktorture.c:865:6: note: Assuming 'reader_tasks' is null
           if (reader_tasks) {
               ^~~~~~~~~~~~
   kernel/locking/locktorture.c:865:2: note: Taking false branch
           if (reader_tasks) {
           ^
   kernel/locking/locktorture.c:874:2: note: Calling 'lock_torture_stats_print'
           lock_torture_stats_print();  /* -After- the stats thread is stopped! */
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/locktorture.c:781:6: note: Assuming field 'readlock' is null
           if (cxt.cur_ops->readlock)
               ^~~~~~~~~~~~~~~~~~~~~
   kernel/locking/locktorture.c:781:2: note: Taking false branch
           if (cxt.cur_ops->readlock)
           ^
   kernel/locking/locktorture.c:784:8: note: Calling 'kmalloc'
           buf = kmalloc(size, GFP_KERNEL);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:579:2: note: Taking false branch
           if (__builtin_constant_p(size)) {
           ^
   include/linux/slab.h:596:9: note: Value assigned to 'cxt.lwsa'
           return __kmalloc(size, flags);
                  ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:596:2: note: Returning pointer, which participates in a condition later
           return __kmalloc(size, flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/locktorture.c:784:8: note: Returning from 'kmalloc'
           buf = kmalloc(size, GFP_KERNEL);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/locktorture.c:785:6: note: Assuming 'buf' is non-null
           if (!buf) {
               ^~~~
   kernel/locking/locktorture.c:785:2: note: Taking false branch
           if (!buf) {
           ^
   kernel/locking/locktorture.c:791:29: note: Passing value via 2nd parameter 'statp'
           __torture_print_stats(buf, cxt.lwsa, true);
                                      ^~~~~~~~
   kernel/locking/locktorture.c:791:2: note: Calling '__torture_print_stats'
           __torture_print_stats(buf, cxt.lwsa, true);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/locking/locktorture.c:744:22: note: Assuming 'statp' is null
           long max = 0, min = statp ? data_race(statp[0].n_lock_acquired) : 0;
                               ^~~~~
   kernel/locking/locktorture.c:744:22: note: '?' condition is false
   kernel/locking/locktorture.c:747:13: note: 'write' is true
           n_stress = write ? cxt.nrealwriters_stress : cxt.nrealreaders_stress;
                      ^~~~~
   kernel/locking/locktorture.c:747:13: note: '?' condition is true
   kernel/locking/locktorture.c:748:14: note: Assuming 'i' is < 'n_stress'
           for (i = 0; i < n_stress; i++) {
                       ^~~~~~~~~~~~
   kernel/locking/locktorture.c:748:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < n_stress; i++) {
           ^
   kernel/locking/locktorture.c:749:17: note: Dereference of null pointer
                   if (data_race(statp[i].n_lock_fail))
                                 ^
   include/linux/compiler.h:218:3: note: expanded from macro 'data_race'
                   expr;                                                   \
                   ^~~~
   kernel/locking/locktorture.c:758:2: warning: Value stored to 'page' is never read [clang-analyzer-deadcode.DeadStores]
           page += sprintf(page,
           ^       ~~~~~~~~~~~~~
   kernel/locking/locktorture.c:758:2: note: Value stored to 'page' is never read
           page += sprintf(page,
           ^       ~~~~~~~~~~~~~
   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.
>> drivers/mailbox/pcc.c:190:6: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
           val &= reg->preserve_mask;
               ^
   drivers/mailbox/pcc.c:345:9: note: Calling 'pcc_chan_reg_read_modify_write'
           return pcc_chan_reg_read_modify_write(&pchan->db);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:184:2: note: 'val' declared without an initial value
           u64 val;
           ^~~~~~~
   drivers/mailbox/pcc.c:186:8: note: Calling 'pcc_chan_reg_read'
           ret = pcc_chan_reg_read(reg, &val);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:153:6: note: Assuming field 'gas' is non-null, which participates in a condition later
           if (!reg->gas) {
               ^~~~~~~~~
   drivers/mailbox/pcc.c:153:2: note: Taking false branch
           if (!reg->gas) {
           ^
   drivers/mailbox/pcc.c:158:6: note: Assuming field 'vaddr' is non-null
           if (reg->vaddr)
               ^~~~~~~~~~
   drivers/mailbox/pcc.c:158:2: note: Taking true branch
           if (reg->vaddr)
           ^
   drivers/mailbox/pcc.c:159:3: note: Calling 'read_register'
                   read_register(reg->vaddr, val, reg->gas->bit_width);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:115:2: note: 'Default' branch taken. Execution continues on line 115
           switch (bit_width) {
           ^
   drivers/mailbox/pcc.c:129:1: note: Returning without writing to '*val'
   }
   ^
   drivers/mailbox/pcc.c:159:3: note: Returning from 'read_register'
                   read_register(reg->vaddr, val, reg->gas->bit_width);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:163:2: note: Returning without writing to '*val'
           return ret;
           ^
   drivers/mailbox/pcc.c:163:2: note: Returning zero (loaded from 'ret'), which participates in a condition later
           return ret;
           ^~~~~~~~~~
   drivers/mailbox/pcc.c:186:8: note: Returning from 'pcc_chan_reg_read'
           ret = pcc_chan_reg_read(reg, &val);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:187:6: note: 'ret' is 0
           if (ret)
               ^~~
   drivers/mailbox/pcc.c:187:2: note: Taking false branch
           if (ret)
           ^
   drivers/mailbox/pcc.c:190:6: note: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
           val &= reg->preserve_mask;
           ~~~ ^
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   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.
   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.
   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.
   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.
   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.
   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.
   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.

vim +190 drivers/mailbox/pcc.c

3cae27675219cd5 Sudeep Holla 2021-07-08  180  
3cae27675219cd5 Sudeep Holla 2021-07-08  181  static int pcc_chan_reg_read_modify_write(struct pcc_chan_reg *reg)
3cae27675219cd5 Sudeep Holla 2021-07-08  182  {
3cae27675219cd5 Sudeep Holla 2021-07-08  183  	int ret = 0;
3cae27675219cd5 Sudeep Holla 2021-07-08  184  	u64 val;
3cae27675219cd5 Sudeep Holla 2021-07-08  185  
3cae27675219cd5 Sudeep Holla 2021-07-08  186  	ret = pcc_chan_reg_read(reg, &val);
3cae27675219cd5 Sudeep Holla 2021-07-08  187  	if (ret)
3cae27675219cd5 Sudeep Holla 2021-07-08  188  		return ret;
3cae27675219cd5 Sudeep Holla 2021-07-08  189  
3cae27675219cd5 Sudeep Holla 2021-07-08 @190  	val &= reg->preserve_mask;
3cae27675219cd5 Sudeep Holla 2021-07-08  191  	val |= reg->set_mask;
3cae27675219cd5 Sudeep Holla 2021-07-08  192  
3cae27675219cd5 Sudeep Holla 2021-07-08  193  	return pcc_chan_reg_write(reg, val);
3cae27675219cd5 Sudeep Holla 2021-07-08  194  }
3cae27675219cd5 Sudeep Holla 2021-07-08  195  

:::::: The code at line 190 was first introduced by commit
:::::: 3cae27675219cd587c6a31a63719110c1307fa3a mailbox: pcc: Add PCC register bundle and associated accessor functions

:::::: TO: Sudeep Holla <sudeep.holla@arm.com>
:::::: CC: Sudeep Holla <sudeep.holla@arm.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33514 bytes --]

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

* [sudeep-holla:v5.15/pcc_type3 11/14] drivers/mailbox/pcc.c:190:6: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
@ 2021-10-21 17:58 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-10-21 17:58 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Sudeep Holla <sudeep.holla@arm.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git v5.15/pcc_type3
head:   db918d7c13901646937da28423737c14528b9379
commit: 6eca3b7aff77252d2cf75ebc9c97697413e3500f [11/14] mailbox: pcc: Drop handling invalid bit-width in {read,write}_register
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: i386-randconfig-c001-20211021 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/commit/?id=6eca3b7aff77252d2cf75ebc9c97697413e3500f
        git remote add sudeep-holla https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git
        git fetch --no-tags sudeep-holla v5.15/pcc_type3
        git checkout 6eca3b7aff77252d2cf75ebc9c97697413e3500f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 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 >>)
   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.
   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.
   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.
   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.
   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.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   drivers/clk/clk-si5341.c:691:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = si5341_encode_44_32(synth->data->regmap,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/clk-si5341.c:691:2: note: Value stored to 'err' is never read
           err = si5341_encode_44_32(synth->data->regmap,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/clk-si5341.c:854:23: warning: Division by zero [clang-analyzer-core.DivideZero]
                   rate = *parent_rate / (r << 1);
                          ~~~~~~~~~~~~~^~~~~~~~~~
   drivers/clk/clk-si5341.c:833:6: note: Assuming 'rate' is not equal to 0
           if (!rate)
               ^~~~~
   drivers/clk/clk-si5341.c:833:2: note: Taking false branch
           if (!rate)
           ^
   drivers/clk/clk-si5341.c:839:6: note: Assuming 'r' is 0
           if (r && !(r % rate))
               ^
   drivers/clk/clk-si5341.c:839:8: note: Left side of '&&' is false
           if (r && !(r % rate))
                 ^
   drivers/clk/clk-si5341.c:842:6: note: Assuming the condition is false
           if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/clk-si5341.c:842:2: note: Taking false branch
           if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
           ^
   drivers/clk/clk-si5341.c:854:23: note: Division by zero
                   rate = *parent_rate / (r << 1);
                          ~~~~~~~~~~~~~^~~~~~~~~~
   drivers/clk/clk-si5341.c:893:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = regmap_bulk_write(output->data->regmap,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/clk-si5341.c:893:2: note: Value stored to 'err' is never read
           err = regmap_bulk_write(output->data->regmap,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   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.
   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.
>> drivers/mailbox/pcc.c:190:6: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
           val &= reg->preserve_mask;
               ^
   drivers/mailbox/pcc.c:345:9: note: Calling 'pcc_chan_reg_read_modify_write'
           return pcc_chan_reg_read_modify_write(&pchan->db);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:184:2: note: 'val' declared without an initial value
           u64 val;
           ^~~~~~~
   drivers/mailbox/pcc.c:186:8: note: Calling 'pcc_chan_reg_read'
           ret = pcc_chan_reg_read(reg, &val);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:153:6: note: Assuming field 'gas' is non-null, which participates in a condition later
           if (!reg->gas) {
               ^~~~~~~~~
   drivers/mailbox/pcc.c:153:2: note: Taking false branch
           if (!reg->gas) {
           ^
   drivers/mailbox/pcc.c:158:6: note: Assuming field 'vaddr' is non-null
           if (reg->vaddr)
               ^~~~~~~~~~
   drivers/mailbox/pcc.c:158:2: note: Taking true branch
           if (reg->vaddr)
           ^
   drivers/mailbox/pcc.c:159:3: note: Calling 'read_register'
                   read_register(reg->vaddr, val, reg->gas->bit_width);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:115:2: note: 'Default' branch taken. Execution continues on line 115
           switch (bit_width) {
           ^
   drivers/mailbox/pcc.c:129:1: note: Returning without writing to '*val'
   }
   ^
   drivers/mailbox/pcc.c:159:3: note: Returning from 'read_register'
                   read_register(reg->vaddr, val, reg->gas->bit_width);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:163:2: note: Returning without writing to '*val'
           return ret;
           ^
   drivers/mailbox/pcc.c:163:2: note: Returning zero (loaded from 'ret'), which participates in a condition later
           return ret;
           ^~~~~~~~~~
   drivers/mailbox/pcc.c:186:8: note: Returning from 'pcc_chan_reg_read'
           ret = pcc_chan_reg_read(reg, &val);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mailbox/pcc.c:187:6: note: 'ret' is 0
           if (ret)
               ^~~
   drivers/mailbox/pcc.c:187:2: note: Taking false branch
           if (ret)
           ^
   drivers/mailbox/pcc.c:190:6: note: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
           val &= reg->preserve_mask;
           ~~~ ^
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   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.
   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.
   drivers/usb/misc/uss720.c:690:2: warning: Value stored to 'i' is never read [clang-analyzer-deadcode.DeadStores]
           i = usb_set_interface(usbdev, intf->altsetting->desc.bInterfaceNumber, 2);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/misc/uss720.c:690:2: note: Value stored to 'i' is never read
           i = usb_set_interface(usbdev, intf->altsetting->desc.bInterfaceNumber, 2);
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   12 warnings generated.
   Suppressed 12 warnings (3 in non-user code, 9 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.
   5 warnings generated.
   drivers/usb/early/ehci-dbgp.c:244:18: warning: The left operand of '<<' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   lo |= bytes[i] << (8*i);
                                  ^
   drivers/usb/early/ehci-dbgp.c:916:6: note: Assuming 'ehci_debug' is non-null
           if (!ehci_debug || dbgp_not_safe)
               ^~~~~~~~~~~
   drivers/usb/early/ehci-dbgp.c:916:6: note: Left side of '||' is false
   drivers/usb/early/ehci-dbgp.c:916:21: note: Assuming 'dbgp_not_safe' is 0
           if (!ehci_debug || dbgp_not_safe)
                              ^~~~~~~~~~~~~
   drivers/usb/early/ehci-dbgp.c:916:2: note: Taking false branch
           if (!ehci_debug || dbgp_not_safe)
           ^
   drivers/usb/early/ehci-dbgp.c:920:15: note: Assuming the condition is true

vim +190 drivers/mailbox/pcc.c

3cae27675219cd Sudeep Holla 2021-07-08  180  
3cae27675219cd Sudeep Holla 2021-07-08  181  static int pcc_chan_reg_read_modify_write(struct pcc_chan_reg *reg)
3cae27675219cd Sudeep Holla 2021-07-08  182  {
3cae27675219cd Sudeep Holla 2021-07-08  183  	int ret = 0;
3cae27675219cd Sudeep Holla 2021-07-08  184  	u64 val;
3cae27675219cd Sudeep Holla 2021-07-08  185  
3cae27675219cd Sudeep Holla 2021-07-08  186  	ret = pcc_chan_reg_read(reg, &val);
3cae27675219cd Sudeep Holla 2021-07-08  187  	if (ret)
3cae27675219cd Sudeep Holla 2021-07-08  188  		return ret;
3cae27675219cd Sudeep Holla 2021-07-08  189  
3cae27675219cd Sudeep Holla 2021-07-08 @190  	val &= reg->preserve_mask;
3cae27675219cd Sudeep Holla 2021-07-08  191  	val |= reg->set_mask;
3cae27675219cd Sudeep Holla 2021-07-08  192  
3cae27675219cd Sudeep Holla 2021-07-08  193  	return pcc_chan_reg_write(reg, val);
3cae27675219cd Sudeep Holla 2021-07-08  194  }
3cae27675219cd Sudeep Holla 2021-07-08  195  

:::::: The code at line 190 was first introduced by commit
:::::: 3cae27675219cd587c6a31a63719110c1307fa3a mailbox: pcc: Add PCC register bundle and associated accessor functions

:::::: TO: Sudeep Holla <sudeep.holla@arm.com>
:::::: CC: Sudeep Holla <sudeep.holla@arm.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33513 bytes --]

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

end of thread, other threads:[~2021-10-26 12:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26 12:00 [sudeep-holla:v5.15/pcc_type3 11/14] drivers/mailbox/pcc.c:190:6: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign] kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-10-21 17:58 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.