All of lore.kernel.org
 help / color / mirror / Atom feed
* [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
@ 2021-08-18 22:09 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-08-18 22:09 UTC (permalink / raw)
  To: Rui Miguel Silva
  Cc: clang-built-linux, kbuild-all, linux-usb, Greg Kroah-Hartman

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
head:   e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb
commit: 7de14c88272c05d86fce83a5cead36832ce3a424 [54/97] usb: isp1760: remove debug message as error
config: riscv-randconfig-c006-20210818 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
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/gregkh/usb.git/commit/?id=7de14c88272c05d86fce83a5cead36832ce3a424
        git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
        git fetch --no-tags usb usb-testing
        git checkout 7de14c88272c05d86fce83a5cead36832ce3a424
        # save the attached .config 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/target/target_core_configfs.c:2627:23: warning: Value stored to 'alua_lu_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
                                ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:2627:23: note: Value stored to 'alua_lu_gp_cg' during its initialization is never read
           struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
                                ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:2731:2: warning: Value stored to 'alua_lu_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
           alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
           ^               ~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:2731:2: note: Value stored to 'alua_lu_gp_ci' is never read
           alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
           ^               ~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:2748:25: warning: Value stored to 'lu_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
                                  ^~~~~
   drivers/target/target_core_configfs.c:2748:25: note: Value stored to 'lu_gp' during its initialization is never read
           struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
                                  ^~~~~
   drivers/target/target_core_configfs.c:3026:23: warning: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
                                ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3026:23: note: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read
           struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
                                ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3163:2: warning: Value stored to 'alua_tg_pt_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
           alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
           ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3163:2: note: Value stored to 'alua_tg_pt_gp_ci' is never read
           alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
           ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3179:28: warning: Value stored to 'tg_pt_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
                                     ^~~~~~~~
   drivers/target/target_core_configfs.c:3179:28: note: Value stored to 'tg_pt_gp' during its initialization is never read
           struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
                                     ^~~~~~~~
   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.
   6 warnings generated.
   drivers/misc/eeprom/at24.c:334:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
           client = at24_client->client;
           ^        ~~~~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/at24.c:334:2: note: Value stored to 'client' is never read
           client = at24_client->client;
           ^        ~~~~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/at24.c:397:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
           client = at24_client->client;
           ^        ~~~~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/at24.c:397:2: note: Value stored to 'client' is never read
           client = at24_client->client;
           ^        ~~~~~~~~~~~~~~~~~~~
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   5 warnings generated.
   drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
           udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
           ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
           udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
           ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   9 warnings generated.
>> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
           scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:735:2: note: Value stored to 'scratch' is never read
           scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1855:38: warning: Division by zero [clang-analyzer-core.DivideZero]
                                   && !(urb->transfer_buffer_length %
                                                                    ^
   drivers/usb/isp1760/isp1760-hcd.c:1887:2: note: Control jumps to 'case 3:'  at line 1891
           switch (usb_pipetype(urb->pipe)) {
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1893:3: note:  Execution continues on line 1911
                   break;
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1911:6: note: Assuming the condition is false
           if (usb_pipein(urb->pipe))
               ^
   include/linux/usb.h:1937:27: note: expanded from macro 'usb_pipein'
   #define usb_pipein(pipe)        ((pipe) & USB_DIR_IN)
                                    ^~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1911:2: note: Taking false branch
           if (usb_pipein(urb->pipe))
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1914:2: note: Calling 'packetize_urb'
           packetize_urb(hcd, urb, &new_qtds, mem_flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1783:6: note: Assuming field 'transfer_buffer' is non-null
           if (!urb->transfer_buffer && urb->transfer_buffer_length) {
               ^~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1783:28: note: Left side of '&&' is false
           if (!urb->transfer_buffer && urb->transfer_buffer_length) {
                                     ^
   drivers/usb/isp1760/isp1760-hcd.c:1792:2: note: Taking false branch
           if (usb_pipein(urb->pipe))
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1797:2: note: Taking false branch
           if (usb_pipecontrol(urb->pipe)) {
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1809:2: note: The value 0 is assigned to 'maxpacketsize'
           maxpacketsize = max_packet(usb_maxpacket(urb->dev, urb->pipe,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1820:2: note: Loop condition is true.  Entering loop body
           for (;;) {
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1823:9: note: Calling 'qtd_alloc'
                   qtd = qtd_alloc(flags, urb, packet_type);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:980:6: note: Assuming 'qtd' is non-null, which participates in a condition later
           if (!qtd)
               ^~~~
   drivers/usb/isp1760/isp1760-hcd.c:980:2: note: Taking false branch
           if (!qtd)
           ^
   drivers/usb/isp1760/isp1760-hcd.c:989:2: note: Returning pointer (loaded from 'qtd'), which participates in a condition later
           return qtd;
           ^~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1823:9: note: Returning from 'qtd_alloc'
                   qtd = qtd_alloc(flags, urb, packet_type);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1824:8: note: 'qtd' is non-null
                   if (!qtd)
                        ^~~
   drivers/usb/isp1760/isp1760-hcd.c:1824:3: note: Taking false branch
                   if (!qtd)
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1827:7: note: Assuming the condition is false
                   if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1])
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1827:3: note: Taking false branch
                   if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1])
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1836:7: note: 'len' is <= 0
                   if (len <= 0)
                       ^~~
   drivers/usb/isp1760/isp1760-hcd.c:1836:3: note: Taking true branch
                   if (len <= 0)
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1837:4: note:  Execution continues on line 1844
                           break;
                           ^
   drivers/usb/isp1760/isp1760-hcd.c:1844:6: note: Assuming field 'transfer_buffer_length' is not equal to 0
           if (urb->transfer_buffer_length != 0) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1844:2: note: Taking true branch
           if (urb->transfer_buffer_length != 0) {
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1847:7: note: Assuming the condition is false
                   if (usb_pipecontrol(urb->pipe)) {
                       ^
   include/linux/usb.h:1946:32: note: expanded from macro 'usb_pipecontrol'
   #define usb_pipecontrol(pipe)   (usb_pipetype((pipe)) == PIPE_CONTROL)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/usb.h:1943:28: note: expanded from macro 'usb_pipetype'
   #define usb_pipetype(pipe)      (((pipe) >> 30) & 3)
                                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1847:3: note: Taking false branch
                   if (usb_pipecontrol(urb->pipe)) {
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1853:14: note: Assuming the condition is true
                   } else if (usb_pipebulk(urb->pipe)

vim +/scratch +735 drivers/usb/isp1760/isp1760-hcd.c

db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  718  
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  719  static int isp1760_hc_setup(struct usb_hcd *hcd)
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  720  {
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  721  	struct isp1760_hcd *priv = hcd_to_priv(hcd);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  722  	u32 atx_reset;
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  723  	int result;
1da9e1c0687335 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  724  	u32 scratch;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  725  	u32 pattern;
1da9e1c0687335 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  726  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  727  	if (priv->is_isp1763)
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  728  		pattern = 0xcafe;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  729  	else
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  730  		pattern = 0xdeadcafe;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  731  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  732  	isp1760_hcd_write(hcd, HC_SCRATCH, pattern);
3faefc88c1a32b drivers/usb/host/isp1760-hcd.c    Nate Case         2008-06-17  733  
3faefc88c1a32b drivers/usb/host/isp1760-hcd.c    Nate Case         2008-06-17  734  	/* Change bus pattern */
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13 @735  	scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  736  	scratch = isp1760_hcd_read(hcd, HC_SCRATCH);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  737  	if (scratch != pattern) {
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  738  		dev_err(hcd->self.controller, "Scratch test failed. 0x%08x\n", scratch);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  739  		return -ENODEV;
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  740  	}
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  741  
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  742  	/*
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  743  	 * The RESET_HC bit in the SW_RESET register is supposed to reset the
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  744  	 * host controller without touching the CPU interface registers, but at
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  745  	 * least on the ISP1761 it seems to behave as the RESET_ALL bit and
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  746  	 * reset the whole device. We thus can't use it here, so let's reset
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  747  	 * the host controller through the EHCI USB Command register. The device
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  748  	 * has been reset in core code anyway, so this shouldn't matter.
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  749  	 */
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  750  	isp1760_hcd_clear(hcd, ISO_BUF_FILL);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  751  	isp1760_hcd_clear(hcd, INT_BUF_FILL);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  752  	isp1760_hcd_clear(hcd, ATL_BUF_FILL);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  753  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  754  	isp1760_hcd_set(hcd, HC_ATL_PTD_SKIPMAP);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  755  	isp1760_hcd_set(hcd, HC_INT_PTD_SKIPMAP);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  756  	isp1760_hcd_set(hcd, HC_ISO_PTD_SKIPMAP);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  757  
6bda21bc0941c1 drivers/usb/host/isp1760-hcd.c    Arvid Brodin      2011-02-26  758  	result = ehci_reset(hcd);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  759  	if (result)
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  760  		return result;
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  761  
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  762  	/* Step 11 passed */
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  763  
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  764  	/* ATL reset */
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  765  	if (priv->is_isp1763)
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  766  		atx_reset = SW_RESET_RESET_ATX;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  767  	else
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  768  		atx_reset = ALL_ATX_RESET;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  769  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  770  	isp1760_hcd_set(hcd, atx_reset);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  771  	mdelay(10);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  772  	isp1760_hcd_clear(hcd, atx_reset);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  773  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  774  	if (priv->is_isp1763) {
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  775  		isp1760_hcd_set(hcd, HW_OTG_DISABLE);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  776  		isp1760_hcd_set(hcd, HW_SW_SEL_HC_DC_CLEAR);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  777  		isp1760_hcd_set(hcd, HW_HC_2_DIS_CLEAR);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  778  		mdelay(10);
3faefc88c1a32b drivers/usb/host/isp1760-hcd.c    Nate Case         2008-06-17  779  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  780  		isp1760_hcd_set(hcd, HW_INTF_LOCK);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  781  	}
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  782  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  783  	isp1760_hcd_set(hcd, HC_INT_IRQ_ENABLE);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  784  	isp1760_hcd_set(hcd, HC_ATL_IRQ_ENABLE);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  785  
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  786  	return priv_init(hcd);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  787  }
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  788  

:::::: The code at line 735 was first introduced by commit
:::::: 60d789f3bfbb7428e6ba2949de70a6db8e12e8fa usb: isp1760: add support for isp1763

:::::: TO: Rui Miguel Silva <rui.silva@linaro.org>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

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

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

* [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
@ 2021-08-18 22:09 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-08-18 22:09 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
head:   e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb
commit: 7de14c88272c05d86fce83a5cead36832ce3a424 [54/97] usb: isp1760: remove debug message as error
config: riscv-randconfig-c006-20210818 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
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/gregkh/usb.git/commit/?id=7de14c88272c05d86fce83a5cead36832ce3a424
        git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
        git fetch --no-tags usb usb-testing
        git checkout 7de14c88272c05d86fce83a5cead36832ce3a424
        # save the attached .config 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/target/target_core_configfs.c:2627:23: warning: Value stored to 'alua_lu_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
                                ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:2627:23: note: Value stored to 'alua_lu_gp_cg' during its initialization is never read
           struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
                                ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:2731:2: warning: Value stored to 'alua_lu_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
           alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
           ^               ~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:2731:2: note: Value stored to 'alua_lu_gp_ci' is never read
           alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
           ^               ~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:2748:25: warning: Value stored to 'lu_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
                                  ^~~~~
   drivers/target/target_core_configfs.c:2748:25: note: Value stored to 'lu_gp' during its initialization is never read
           struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
                                  ^~~~~
   drivers/target/target_core_configfs.c:3026:23: warning: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
                                ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3026:23: note: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read
           struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
                                ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3163:2: warning: Value stored to 'alua_tg_pt_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
           alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
           ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3163:2: note: Value stored to 'alua_tg_pt_gp_ci' is never read
           alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
           ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3179:28: warning: Value stored to 'tg_pt_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
                                     ^~~~~~~~
   drivers/target/target_core_configfs.c:3179:28: note: Value stored to 'tg_pt_gp' during its initialization is never read
           struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
                                     ^~~~~~~~
   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.
   6 warnings generated.
   drivers/misc/eeprom/at24.c:334:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
           client = at24_client->client;
           ^        ~~~~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/at24.c:334:2: note: Value stored to 'client' is never read
           client = at24_client->client;
           ^        ~~~~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/at24.c:397:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
           client = at24_client->client;
           ^        ~~~~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/at24.c:397:2: note: Value stored to 'client' is never read
           client = at24_client->client;
           ^        ~~~~~~~~~~~~~~~~~~~
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   5 warnings generated.
   drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
           udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
           ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
           udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
           ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   9 warnings generated.
>> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
           scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:735:2: note: Value stored to 'scratch' is never read
           scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1855:38: warning: Division by zero [clang-analyzer-core.DivideZero]
                                   && !(urb->transfer_buffer_length %
                                                                    ^
   drivers/usb/isp1760/isp1760-hcd.c:1887:2: note: Control jumps to 'case 3:'  at line 1891
           switch (usb_pipetype(urb->pipe)) {
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1893:3: note:  Execution continues on line 1911
                   break;
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1911:6: note: Assuming the condition is false
           if (usb_pipein(urb->pipe))
               ^
   include/linux/usb.h:1937:27: note: expanded from macro 'usb_pipein'
   #define usb_pipein(pipe)        ((pipe) & USB_DIR_IN)
                                    ^~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1911:2: note: Taking false branch
           if (usb_pipein(urb->pipe))
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1914:2: note: Calling 'packetize_urb'
           packetize_urb(hcd, urb, &new_qtds, mem_flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1783:6: note: Assuming field 'transfer_buffer' is non-null
           if (!urb->transfer_buffer && urb->transfer_buffer_length) {
               ^~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1783:28: note: Left side of '&&' is false
           if (!urb->transfer_buffer && urb->transfer_buffer_length) {
                                     ^
   drivers/usb/isp1760/isp1760-hcd.c:1792:2: note: Taking false branch
           if (usb_pipein(urb->pipe))
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1797:2: note: Taking false branch
           if (usb_pipecontrol(urb->pipe)) {
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1809:2: note: The value 0 is assigned to 'maxpacketsize'
           maxpacketsize = max_packet(usb_maxpacket(urb->dev, urb->pipe,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1820:2: note: Loop condition is true.  Entering loop body
           for (;;) {
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1823:9: note: Calling 'qtd_alloc'
                   qtd = qtd_alloc(flags, urb, packet_type);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:980:6: note: Assuming 'qtd' is non-null, which participates in a condition later
           if (!qtd)
               ^~~~
   drivers/usb/isp1760/isp1760-hcd.c:980:2: note: Taking false branch
           if (!qtd)
           ^
   drivers/usb/isp1760/isp1760-hcd.c:989:2: note: Returning pointer (loaded from 'qtd'), which participates in a condition later
           return qtd;
           ^~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1823:9: note: Returning from 'qtd_alloc'
                   qtd = qtd_alloc(flags, urb, packet_type);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1824:8: note: 'qtd' is non-null
                   if (!qtd)
                        ^~~
   drivers/usb/isp1760/isp1760-hcd.c:1824:3: note: Taking false branch
                   if (!qtd)
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1827:7: note: Assuming the condition is false
                   if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1])
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1827:3: note: Taking false branch
                   if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1])
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1836:7: note: 'len' is <= 0
                   if (len <= 0)
                       ^~~
   drivers/usb/isp1760/isp1760-hcd.c:1836:3: note: Taking true branch
                   if (len <= 0)
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1837:4: note:  Execution continues on line 1844
                           break;
                           ^
   drivers/usb/isp1760/isp1760-hcd.c:1844:6: note: Assuming field 'transfer_buffer_length' is not equal to 0
           if (urb->transfer_buffer_length != 0) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/isp1760/isp1760-hcd.c:1844:2: note: Taking true branch
           if (urb->transfer_buffer_length != 0) {
           ^
   drivers/usb/isp1760/isp1760-hcd.c:1847:7: note: Assuming the condition is false
                   if (usb_pipecontrol(urb->pipe)) {
                       ^
   include/linux/usb.h:1946:32: note: expanded from macro 'usb_pipecontrol'
   #define usb_pipecontrol(pipe)   (usb_pipetype((pipe)) == PIPE_CONTROL)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/usb.h:1943:28: note: expanded from macro 'usb_pipetype'
   #define usb_pipetype(pipe)      (((pipe) >> 30) & 3)
                                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1847:3: note: Taking false branch
                   if (usb_pipecontrol(urb->pipe)) {
                   ^
   drivers/usb/isp1760/isp1760-hcd.c:1853:14: note: Assuming the condition is true
                   } else if (usb_pipebulk(urb->pipe)

vim +/scratch +735 drivers/usb/isp1760/isp1760-hcd.c

db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  718  
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  719  static int isp1760_hc_setup(struct usb_hcd *hcd)
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  720  {
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  721  	struct isp1760_hcd *priv = hcd_to_priv(hcd);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  722  	u32 atx_reset;
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  723  	int result;
1da9e1c0687335 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  724  	u32 scratch;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  725  	u32 pattern;
1da9e1c0687335 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  726  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  727  	if (priv->is_isp1763)
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  728  		pattern = 0xcafe;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  729  	else
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  730  		pattern = 0xdeadcafe;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  731  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  732  	isp1760_hcd_write(hcd, HC_SCRATCH, pattern);
3faefc88c1a32b drivers/usb/host/isp1760-hcd.c    Nate Case         2008-06-17  733  
3faefc88c1a32b drivers/usb/host/isp1760-hcd.c    Nate Case         2008-06-17  734  	/* Change bus pattern */
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13 @735  	scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  736  	scratch = isp1760_hcd_read(hcd, HC_SCRATCH);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  737  	if (scratch != pattern) {
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  738  		dev_err(hcd->self.controller, "Scratch test failed. 0x%08x\n", scratch);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  739  		return -ENODEV;
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  740  	}
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  741  
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  742  	/*
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  743  	 * The RESET_HC bit in the SW_RESET register is supposed to reset the
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  744  	 * host controller without touching the CPU interface registers, but at
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  745  	 * least on the ISP1761 it seems to behave as the RESET_ALL bit and
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  746  	 * reset the whole device. We thus can't use it here, so let's reset
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  747  	 * the host controller through the EHCI USB Command register. The device
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  748  	 * has been reset in core code anyway, so this shouldn't matter.
5171446a3aec60 drivers/usb/host/isp1760-hcd.c    Laurent Pinchart  2015-01-21  749  	 */
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  750  	isp1760_hcd_clear(hcd, ISO_BUF_FILL);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  751  	isp1760_hcd_clear(hcd, INT_BUF_FILL);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  752  	isp1760_hcd_clear(hcd, ATL_BUF_FILL);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  753  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  754  	isp1760_hcd_set(hcd, HC_ATL_PTD_SKIPMAP);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  755  	isp1760_hcd_set(hcd, HC_INT_PTD_SKIPMAP);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  756  	isp1760_hcd_set(hcd, HC_ISO_PTD_SKIPMAP);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  757  
6bda21bc0941c1 drivers/usb/host/isp1760-hcd.c    Arvid Brodin      2011-02-26  758  	result = ehci_reset(hcd);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  759  	if (result)
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  760  		return result;
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  761  
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  762  	/* Step 11 passed */
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  763  
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  764  	/* ATL reset */
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  765  	if (priv->is_isp1763)
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  766  		atx_reset = SW_RESET_RESET_ATX;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  767  	else
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  768  		atx_reset = ALL_ATX_RESET;
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  769  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  770  	isp1760_hcd_set(hcd, atx_reset);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  771  	mdelay(10);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  772  	isp1760_hcd_clear(hcd, atx_reset);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  773  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  774  	if (priv->is_isp1763) {
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  775  		isp1760_hcd_set(hcd, HW_OTG_DISABLE);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  776  		isp1760_hcd_set(hcd, HW_SW_SEL_HC_DC_CLEAR);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  777  		isp1760_hcd_set(hcd, HW_HC_2_DIS_CLEAR);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  778  		mdelay(10);
3faefc88c1a32b drivers/usb/host/isp1760-hcd.c    Nate Case         2008-06-17  779  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  780  		isp1760_hcd_set(hcd, HW_INTF_LOCK);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  781  	}
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  782  
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  783  	isp1760_hcd_set(hcd, HC_INT_IRQ_ENABLE);
60d789f3bfbb74 drivers/usb/isp1760/isp1760-hcd.c Rui Miguel Silva  2021-05-13  784  	isp1760_hcd_set(hcd, HC_ATL_IRQ_ENABLE);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  785  
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  786  	return priv_init(hcd);
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  787  }
db11e47dd7b09b drivers/usb/host/isp1760-hcd.c    Sebastian Siewior 2008-04-24  788  

:::::: The code at line 735 was first introduced by commit
:::::: 60d789f3bfbb7428e6ba2949de70a6db8e12e8fa usb: isp1760: add support for isp1763

:::::: TO: Rui Miguel Silva <rui.silva@linaro.org>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
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: 32299 bytes --]

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

* Re: [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
  2021-08-18 22:09 ` kernel test robot
@ 2021-08-19  7:47   ` Rui Miguel Silva
  -1 siblings, 0 replies; 8+ messages in thread
From: Rui Miguel Silva @ 2021-08-19  7:47 UTC (permalink / raw)
  To: kernel test robot
  Cc: clang-built-linux, kbuild-all, linux-usb, Greg Kroah-Hartman

Hi,
On Wed Aug 18, 2021 at 11:09 PM WEST, kernel test robot wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> head:   e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb
> commit: 7de14c88272c05d86fce83a5cead36832ce3a424 [54/97] usb: isp1760: remove debug message as error
> config: riscv-randconfig-c006-20210818 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
> 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/gregkh/usb.git/commit/?id=7de14c88272c05d86fce83a5cead36832ce3a424
>         git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
>         git fetch --no-tags usb usb-testing
>         git checkout 7de14c88272c05d86fce83a5cead36832ce3a424
>         # save the attached .config 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/target/target_core_configfs.c:2627:23: warning: Value stored to 'alua_lu_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
>            struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
>                                 ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:2627:23: note: Value stored to 'alua_lu_gp_cg' during its initialization is never read
>            struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
>                                 ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:2731:2: warning: Value stored to 'alua_lu_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
>            alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
>            ^               ~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:2731:2: note: Value stored to 'alua_lu_gp_ci' is never read
>            alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
>            ^               ~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:2748:25: warning: Value stored to 'lu_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
>            struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
>                                   ^~~~~
>    drivers/target/target_core_configfs.c:2748:25: note: Value stored to 'lu_gp' during its initialization is never read
>            struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
>                                   ^~~~~
>    drivers/target/target_core_configfs.c:3026:23: warning: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
>            struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
>                                 ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:3026:23: note: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read
>            struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
>                                 ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:3163:2: warning: Value stored to 'alua_tg_pt_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
>            alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
>            ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:3163:2: note: Value stored to 'alua_tg_pt_gp_ci' is never read
>            alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
>            ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:3179:28: warning: Value stored to 'tg_pt_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
>            struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
>                                      ^~~~~~~~
>    drivers/target/target_core_configfs.c:3179:28: note: Value stored to 'tg_pt_gp' during its initialization is never read
>            struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
>                                      ^~~~~~~~
>    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.
>    6 warnings generated.
>    drivers/misc/eeprom/at24.c:334:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
>            client = at24_client->client;
>            ^        ~~~~~~~~~~~~~~~~~~~
>    drivers/misc/eeprom/at24.c:334:2: note: Value stored to 'client' is never read
>            client = at24_client->client;
>            ^        ~~~~~~~~~~~~~~~~~~~
>    drivers/misc/eeprom/at24.c:397:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
>            client = at24_client->client;
>            ^        ~~~~~~~~~~~~~~~~~~~
>    drivers/misc/eeprom/at24.c:397:2: note: Value stored to 'client' is never read
>            client = at24_client->client;
>            ^        ~~~~~~~~~~~~~~~~~~~
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    5 warnings generated.
>    drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
>            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
>            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
>            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
>            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    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.
>    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.
>    9 warnings generated.
> >> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
>            scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
>            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

yeah, this is desired behaviour, this read is only to make sure  that
we make something different than the pattern to test go over the bus.
However I will take a look to this warning and other clang warnings
that I am seeing in this report.

------
Cheers,
     Rui

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

* Re: [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
@ 2021-08-19  7:47   ` Rui Miguel Silva
  0 siblings, 0 replies; 8+ messages in thread
From: Rui Miguel Silva @ 2021-08-19  7:47 UTC (permalink / raw)
  To: kbuild-all

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

Hi,
On Wed Aug 18, 2021 at 11:09 PM WEST, kernel test robot wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> head:   e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb
> commit: 7de14c88272c05d86fce83a5cead36832ce3a424 [54/97] usb: isp1760: remove debug message as error
> config: riscv-randconfig-c006-20210818 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
> 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/gregkh/usb.git/commit/?id=7de14c88272c05d86fce83a5cead36832ce3a424
>         git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
>         git fetch --no-tags usb usb-testing
>         git checkout 7de14c88272c05d86fce83a5cead36832ce3a424
>         # save the attached .config 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/target/target_core_configfs.c:2627:23: warning: Value stored to 'alua_lu_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
>            struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
>                                 ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:2627:23: note: Value stored to 'alua_lu_gp_cg' during its initialization is never read
>            struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
>                                 ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:2731:2: warning: Value stored to 'alua_lu_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
>            alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
>            ^               ~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:2731:2: note: Value stored to 'alua_lu_gp_ci' is never read
>            alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
>            ^               ~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:2748:25: warning: Value stored to 'lu_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
>            struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
>                                   ^~~~~
>    drivers/target/target_core_configfs.c:2748:25: note: Value stored to 'lu_gp' during its initialization is never read
>            struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
>                                   ^~~~~
>    drivers/target/target_core_configfs.c:3026:23: warning: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
>            struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
>                                 ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:3026:23: note: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read
>            struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
>                                 ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:3163:2: warning: Value stored to 'alua_tg_pt_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
>            alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
>            ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:3163:2: note: Value stored to 'alua_tg_pt_gp_ci' is never read
>            alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
>            ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/target/target_core_configfs.c:3179:28: warning: Value stored to 'tg_pt_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
>            struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
>                                      ^~~~~~~~
>    drivers/target/target_core_configfs.c:3179:28: note: Value stored to 'tg_pt_gp' during its initialization is never read
>            struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
>                                      ^~~~~~~~
>    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.
>    6 warnings generated.
>    drivers/misc/eeprom/at24.c:334:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
>            client = at24_client->client;
>            ^        ~~~~~~~~~~~~~~~~~~~
>    drivers/misc/eeprom/at24.c:334:2: note: Value stored to 'client' is never read
>            client = at24_client->client;
>            ^        ~~~~~~~~~~~~~~~~~~~
>    drivers/misc/eeprom/at24.c:397:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
>            client = at24_client->client;
>            ^        ~~~~~~~~~~~~~~~~~~~
>    drivers/misc/eeprom/at24.c:397:2: note: Value stored to 'client' is never read
>            client = at24_client->client;
>            ^        ~~~~~~~~~~~~~~~~~~~
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    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.
>    5 warnings generated.
>    drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
>            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
>            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
>            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
>            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    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.
>    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.
>    9 warnings generated.
> >> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
>            scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
>            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

yeah, this is desired behaviour, this read is only to make sure  that
we make something different than the pattern to test go over the bus.
However I will take a look to this warning and other clang warnings
that I am seeing in this report.

------
Cheers,
     Rui

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

* Re: [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
  2021-08-19  7:47   ` Rui Miguel Silva
@ 2021-08-19 14:59     ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-19 14:59 UTC (permalink / raw)
  To: Rui Miguel Silva
  Cc: kernel test robot, clang-built-linux, kbuild-all, linux-usb

On Thu, Aug 19, 2021 at 08:47:37AM +0100, Rui Miguel Silva wrote:
> Hi,
> On Wed Aug 18, 2021 at 11:09 PM WEST, kernel test robot wrote:
> 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> > head:   e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb
> > commit: 7de14c88272c05d86fce83a5cead36832ce3a424 [54/97] usb: isp1760: remove debug message as error
> > config: riscv-randconfig-c006-20210818 (attached as .config)
> > compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
> > 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/gregkh/usb.git/commit/?id=7de14c88272c05d86fce83a5cead36832ce3a424
> >         git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
> >         git fetch --no-tags usb usb-testing
> >         git checkout 7de14c88272c05d86fce83a5cead36832ce3a424
> >         # save the attached .config 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/target/target_core_configfs.c:2627:23: warning: Value stored to 'alua_lu_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> >            struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
> >                                 ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:2627:23: note: Value stored to 'alua_lu_gp_cg' during its initialization is never read
> >            struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
> >                                 ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:2731:2: warning: Value stored to 'alua_lu_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
> >            alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
> >            ^               ~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:2731:2: note: Value stored to 'alua_lu_gp_ci' is never read
> >            alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
> >            ^               ~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:2748:25: warning: Value stored to 'lu_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> >            struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
> >                                   ^~~~~
> >    drivers/target/target_core_configfs.c:2748:25: note: Value stored to 'lu_gp' during its initialization is never read
> >            struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
> >                                   ^~~~~
> >    drivers/target/target_core_configfs.c:3026:23: warning: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> >            struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
> >                                 ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:3026:23: note: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read
> >            struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
> >                                 ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:3163:2: warning: Value stored to 'alua_tg_pt_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
> >            alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
> >            ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:3163:2: note: Value stored to 'alua_tg_pt_gp_ci' is never read
> >            alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
> >            ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:3179:28: warning: Value stored to 'tg_pt_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> >            struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
> >                                      ^~~~~~~~
> >    drivers/target/target_core_configfs.c:3179:28: note: Value stored to 'tg_pt_gp' during its initialization is never read
> >            struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
> >                                      ^~~~~~~~
> >    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.
> >    6 warnings generated.
> >    drivers/misc/eeprom/at24.c:334:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
> >            client = at24_client->client;
> >            ^        ~~~~~~~~~~~~~~~~~~~
> >    drivers/misc/eeprom/at24.c:334:2: note: Value stored to 'client' is never read
> >            client = at24_client->client;
> >            ^        ~~~~~~~~~~~~~~~~~~~
> >    drivers/misc/eeprom/at24.c:397:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
> >            client = at24_client->client;
> >            ^        ~~~~~~~~~~~~~~~~~~~
> >    drivers/misc/eeprom/at24.c:397:2: note: Value stored to 'client' is never read
> >            client = at24_client->client;
> >            ^        ~~~~~~~~~~~~~~~~~~~
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    5 warnings generated.
> >    drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
> >            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
> >            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
> >            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
> >            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    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.
> >    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.
> >    9 warnings generated.
> > >> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
> >            scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
> >            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> yeah, this is desired behaviour, this read is only to make sure  that
> we make something different than the pattern to test go over the bus.
> However I will take a look to this warning and other clang warnings
> that I am seeing in this report.

This is why I hate this type of warning, doing a read like this is
totally normal for drivers.  Compilers that think this is something they
can ignore or warn about are just wrong.

greg k-h

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

* Re: [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
@ 2021-08-19 14:59     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-19 14:59 UTC (permalink / raw)
  To: kbuild-all

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

On Thu, Aug 19, 2021 at 08:47:37AM +0100, Rui Miguel Silva wrote:
> Hi,
> On Wed Aug 18, 2021 at 11:09 PM WEST, kernel test robot wrote:
> 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> > head:   e4788edc730a0d2b26e1ae1f08fbb3f635b92dbb
> > commit: 7de14c88272c05d86fce83a5cead36832ce3a424 [54/97] usb: isp1760: remove debug message as error
> > config: riscv-randconfig-c006-20210818 (attached as .config)
> > compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
> > 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/gregkh/usb.git/commit/?id=7de14c88272c05d86fce83a5cead36832ce3a424
> >         git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
> >         git fetch --no-tags usb usb-testing
> >         git checkout 7de14c88272c05d86fce83a5cead36832ce3a424
> >         # save the attached .config 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/target/target_core_configfs.c:2627:23: warning: Value stored to 'alua_lu_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> >            struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
> >                                 ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:2627:23: note: Value stored to 'alua_lu_gp_cg' during its initialization is never read
> >            struct config_group *alua_lu_gp_cg = &lu_gp->lu_gp_group;
> >                                 ^~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:2731:2: warning: Value stored to 'alua_lu_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
> >            alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
> >            ^               ~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:2731:2: note: Value stored to 'alua_lu_gp_ci' is never read
> >            alua_lu_gp_ci = &alua_lu_gp_cg->cg_item;
> >            ^               ~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:2748:25: warning: Value stored to 'lu_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> >            struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
> >                                   ^~~~~
> >    drivers/target/target_core_configfs.c:2748:25: note: Value stored to 'lu_gp' during its initialization is never read
> >            struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
> >                                   ^~~~~
> >    drivers/target/target_core_configfs.c:3026:23: warning: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> >            struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
> >                                 ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:3026:23: note: Value stored to 'alua_tg_pt_gp_cg' during its initialization is never read
> >            struct config_group *alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
> >                                 ^~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:3163:2: warning: Value stored to 'alua_tg_pt_gp_ci' is never read [clang-analyzer-deadcode.DeadStores]
> >            alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
> >            ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:3163:2: note: Value stored to 'alua_tg_pt_gp_ci' is never read
> >            alua_tg_pt_gp_ci = &alua_tg_pt_gp_cg->cg_item;
> >            ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/target/target_core_configfs.c:3179:28: warning: Value stored to 'tg_pt_gp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> >            struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
> >                                      ^~~~~~~~
> >    drivers/target/target_core_configfs.c:3179:28: note: Value stored to 'tg_pt_gp' during its initialization is never read
> >            struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
> >                                      ^~~~~~~~
> >    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.
> >    6 warnings generated.
> >    drivers/misc/eeprom/at24.c:334:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
> >            client = at24_client->client;
> >            ^        ~~~~~~~~~~~~~~~~~~~
> >    drivers/misc/eeprom/at24.c:334:2: note: Value stored to 'client' is never read
> >            client = at24_client->client;
> >            ^        ~~~~~~~~~~~~~~~~~~~
> >    drivers/misc/eeprom/at24.c:397:2: warning: Value stored to 'client' is never read [clang-analyzer-deadcode.DeadStores]
> >            client = at24_client->client;
> >            ^        ~~~~~~~~~~~~~~~~~~~
> >    drivers/misc/eeprom/at24.c:397:2: note: Value stored to 'client' is never read
> >            client = at24_client->client;
> >            ^        ~~~~~~~~~~~~~~~~~~~
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    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.
> >    5 warnings generated.
> >    drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
> >            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
> >            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
> >            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
> >            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    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.
> >    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.
> >    9 warnings generated.
> > >> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
> >            scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
> >            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> yeah, this is desired behaviour, this read is only to make sure  that
> we make something different than the pattern to test go over the bus.
> However I will take a look to this warning and other clang warnings
> that I am seeing in this report.

This is why I hate this type of warning, doing a read like this is
totally normal for drivers.  Compilers that think this is something they
can ignore or warn about are just wrong.

greg k-h

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

* Re: [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
  2021-08-19 14:59     ` Greg Kroah-Hartman
@ 2021-08-19 15:06       ` Alan Stern
  -1 siblings, 0 replies; 8+ messages in thread
From: Alan Stern @ 2021-08-19 15:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rui Miguel Silva, kernel test robot, clang-built-linux,
	kbuild-all, linux-usb

On Thu, Aug 19, 2021 at 04:59:04PM +0200, Greg Kroah-Hartman wrote:
> On Thu, Aug 19, 2021 at 08:47:37AM +0100, Rui Miguel Silva wrote:
> > Hi,
> > On Wed Aug 18, 2021 at 11:09 PM WEST, kernel test robot wrote:

> > >    drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
> > >            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
> > >            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >    drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
> > >            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
> > >            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >    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.
> > >    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.
> > >    9 warnings generated.
> > > >> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
> > >            scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
> > >            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > yeah, this is desired behaviour, this read is only to make sure  that
> > we make something different than the pattern to test go over the bus.
> > However I will take a look to this warning and other clang warnings
> > that I am seeing in this report.
> 
> This is why I hate this type of warning, doing a read like this is
> totally normal for drivers.  Compilers that think this is something they
> can ignore or warn about are just wrong.

No, no.  The compiler isn't complaining about the call to 
isp1760_hcd_read(); it's complaining about the fact that scratch 
stores the return value.  Since the value isn't used anywhere, there's 
no point in storing it.

You can get rid of the warning by changing the line to:

		(void) isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);

(The (void) cast isn't really necessary; it's just there to point out 
that the return value is being thrown away.  You can omit it if you 
prefer.)

Likewise for the store to udc_enabled.

Alan Stern

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

* Re: [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
@ 2021-08-19 15:06       ` Alan Stern
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Stern @ 2021-08-19 15:06 UTC (permalink / raw)
  To: kbuild-all

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

On Thu, Aug 19, 2021 at 04:59:04PM +0200, Greg Kroah-Hartman wrote:
> On Thu, Aug 19, 2021 at 08:47:37AM +0100, Rui Miguel Silva wrote:
> > Hi,
> > On Wed Aug 18, 2021 at 11:09 PM WEST, kernel test robot wrote:

> > >    drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
> > >            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
> > >            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >    drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
> > >            udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
> > >            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >    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.
> > >    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.
> > >    9 warnings generated.
> > > >> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
> > >            scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
> > >            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > yeah, this is desired behaviour, this read is only to make sure  that
> > we make something different than the pattern to test go over the bus.
> > However I will take a look to this warning and other clang warnings
> > that I am seeing in this report.
> 
> This is why I hate this type of warning, doing a read like this is
> totally normal for drivers.  Compilers that think this is something they
> can ignore or warn about are just wrong.

No, no.  The compiler isn't complaining about the call to 
isp1760_hcd_read(); it's complaining about the fact that scratch 
stores the return value.  Since the value isn't used anywhere, there's 
no point in storing it.

You can get rid of the warning by changing the line to:

		(void) isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);

(The (void) cast isn't really necessary; it's just there to point out 
that the return value is being thrown away.  You can omit it if you 
prefer.)

Likewise for the store to udc_enabled.

Alan Stern

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

end of thread, other threads:[~2021-08-19 15:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 22:09 [usb:usb-testing 54/97] drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
2021-08-18 22:09 ` kernel test robot
2021-08-19  7:47 ` Rui Miguel Silva
2021-08-19  7:47   ` Rui Miguel Silva
2021-08-19 14:59   ` Greg Kroah-Hartman
2021-08-19 14:59     ` Greg Kroah-Hartman
2021-08-19 15:06     ` Alan Stern
2021-08-19 15:06       ` Alan Stern

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.