All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [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]
Date: Fri, 22 Oct 2021 01:58:11 +0800	[thread overview]
Message-ID: <202110220104.K92nPO3z-lkp@intel.com> (raw)

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

             reply	other threads:[~2021-10-21 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 17:58 kernel test robot [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202110220104.K92nPO3z-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.