All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores]
@ 2022-02-27 10:51 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-02-27 10:51 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Hannes Reinecke <hare@suse.de>
CC: Damien Le Moal <damien.lemoal@opensource.wdc.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2293be58d6a18cab800e25e42081bacb75c05752
commit: 742bef476ca5352b16063161fb73a56629a6d995 ata: libata: move ata_{port,link,dev}_dbg to standard pr_XXX() macros
date:   8 weeks ago
:::::: branch date: 15 hours ago
:::::: commit date: 8 weeks ago
config: riscv-randconfig-c006-20220222 (https://download.01.org/0day-ci/archive/20220227/202202271848.wt5soFuB-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=742bef476ca5352b16063161fb73a56629a6d995
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 742bef476ca5352b16063161fb73a56629a6d995
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   include/linux/dev_printk.h:150:2: note: expanded from macro 'dev_info'
           dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/dev_printk.h:109:3: note: expanded from macro 'dev_printk_index_wrap'
                   dev_printk_index_emit(level, fmt);                      \
                   ^
   include/linux/dev_printk.h:105:2: note: expanded from macro 'dev_printk_index_emit'
           printk_index_subsys_emit("%s %s: ", level, fmt)
           ^
   include/linux/printk.h:417:2: note: expanded from macro 'printk_index_subsys_emit'
           __printk_index_emit(fmt, level, subsys_fmt_prefix)
           ^
   include/linux/printk.h:383:12: note: expanded from macro '__printk_index_emit'
                                   .fmt = __builtin_constant_p(_fmt) ? (_fmt) : NULL, \
                                          ^
   drivers/base/test/test_async_driver_probe.c:166:2: note: '?' condition is true
           dev_info(&(*pdev)->dev,
           ^
   include/linux/dev_printk.h:150:2: note: expanded from macro 'dev_info'
           dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/dev_printk.h:109:3: note: expanded from macro 'dev_printk_index_wrap'
                   dev_printk_index_emit(level, fmt);                      \
                   ^
   include/linux/dev_printk.h:105:2: note: expanded from macro 'dev_printk_index_emit'
           printk_index_subsys_emit("%s %s: ", level, fmt)
           ^
   include/linux/printk.h:417:2: note: expanded from macro 'printk_index_subsys_emit'
           __printk_index_emit(fmt, level, subsys_fmt_prefix)
           ^
   include/linux/printk.h:387:14: note: expanded from macro '__printk_index_emit'
                                   .level = __builtin_constant_p(_level) ? (_level) : NULL, \
                                            ^
   drivers/base/test/test_async_driver_probe.c:166:2: note: Loop condition is false.  Exiting loop
           dev_info(&(*pdev)->dev,
           ^
   include/linux/dev_printk.h:150:2: note: expanded from macro 'dev_info'
           dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/dev_printk.h:109:3: note: expanded from macro 'dev_printk_index_wrap'
                   dev_printk_index_emit(level, fmt);                      \
                   ^
   include/linux/dev_printk.h:105:2: note: expanded from macro 'dev_printk_index_emit'
           printk_index_subsys_emit("%s %s: ", level, fmt)
           ^
   include/linux/printk.h:417:2: note: expanded from macro 'printk_index_subsys_emit'
           __printk_index_emit(fmt, level, subsys_fmt_prefix)
           ^
   include/linux/printk.h:373:2: note: expanded from macro '__printk_index_emit'
           do {                                                            \
           ^
   drivers/base/test/test_async_driver_probe.c:166:12: note: Dereference of null pointer (loaded from variable 'pdev')
           dev_info(&(*pdev)->dev,
                     ^
   include/linux/dev_printk.h:150:46: note: expanded from macro 'dev_info'
           dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
                                                       ^~~
   include/linux/dev_printk.h:110:11: note: expanded from macro 'dev_printk_index_wrap'
                   _p_func(dev, fmt, ##__VA_ARGS__);                       \
                           ^~~
   drivers/base/test/test_async_driver_probe.c:177:2: warning: Value stored to 'nid' is never read [clang-analyzer-deadcode.DeadStores]
           nid = cpu_to_node(cpu);
           ^
   drivers/base/test/test_async_driver_probe.c:177:2: note: Value stored to 'nid' is never read
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   fs/gfs2/ops_fstype.c:852:2: warning: Value stored to 'jindex' is never read [clang-analyzer-deadcode.DeadStores]
           jindex = 0;
           ^        ~
   fs/gfs2/ops_fstype.c:852:2: note: Value stored to 'jindex' is never read
           jindex = 0;
           ^        ~
   Suppressed 7 warnings (7 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.
   fs/gfs2/inode.c:1493:4: warning: Value stored to 'error' is never read [clang-analyzer-deadcode.DeadStores]
                           error = 0;
                           ^       ~
   fs/gfs2/inode.c:1493:4: note: Value stored to 'error' is never read
                           error = 0;
                           ^       ~
   fs/gfs2/inode.c:1558:3: warning: Value stored to 'error' is never read [clang-analyzer-deadcode.DeadStores]
                   error = gfs2_unlink_inode(ndip, ndentry);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/gfs2/inode.c:1558:3: note: Value stored to 'error' is never read
                   error = gfs2_unlink_inode(ndip, ndentry);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   fs/gfs2/quota.c:839:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = -EIO;
           ^     ~~~~
   fs/gfs2/quota.c:839:2: note: Value stored to 'err' is never read
           err = -EIO;
           ^     ~~~~
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   10 warnings generated.
>> drivers/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores]
           udma = saved_udma = (unsigned long)ap->host->private_data;
                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ata/pata_amd.c:280:9: note: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma'
           udma = saved_udma = (unsigned long)ap->host->private_data;
                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   Suppressed 9 warnings (9 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   15 warnings generated.
   kernel/rcu/tree.c:279:2: warning: Value stored to 'seq' is never read [clang-analyzer-deadcode.DeadStores]
           seq = rcu_dynticks_inc(1);
           ^     ~~~~~~~~~~~~~~~~~~~
   kernel/rcu/tree.c:279:2: note: Value stored to 'seq' is never read
           seq = rcu_dynticks_inc(1);
           ^     ~~~~~~~~~~~~~~~~~~~
   kernel/rcu/tree.c:298:2: warning: Value stored to 'seq' is never read [clang-analyzer-deadcode.DeadStores]
           seq = rcu_dynticks_inc(1);
           ^     ~~~~~~~~~~~~~~~~~~~
   kernel/rcu/tree.c:298:2: note: Value stored to 'seq' is never read
           seq = rcu_dynticks_inc(1);
           ^     ~~~~~~~~~~~~~~~~~~~
   Suppressed 13 warnings (13 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   drivers/i2c/algos/i2c-algo-pca.c:195:10: warning: Although the value stored to 'state' is used in the enclosing expression, the value is never actually read from 'state' [clang-analyzer-deadcode.DeadStores]
           while ((state = pca_status(adap)) != 0xf8) {
                   ^
   drivers/i2c/algos/i2c-algo-pca.c:195:10: note: Although the value stored to 'state' is used in the enclosing expression, the value is never actually read from 'state'
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   drivers/regulator/core.c:3792:3: warning: Value stored to 'possible_uV' is never read [clang-analyzer-deadcode.DeadStores]

vim +280 drivers/ata/pata_amd.c

669a5db411d85a Jeff Garzik    2006-08-29  260  
ce54d161630211 Tejun Heo      2007-12-18  261  /* Both host-side and drive-side detection results are worthless on NV
ce54d161630211 Tejun Heo      2007-12-18  262   * PATAs.  Ignore them and just follow what BIOS configured.  Both the
ce54d161630211 Tejun Heo      2007-12-18  263   * current configuration in PCI config reg and ACPI GTM result are
ce54d161630211 Tejun Heo      2007-12-18  264   * cached during driver attach and are consulted to select transfer
ce54d161630211 Tejun Heo      2007-12-18  265   * mode.
ce54d161630211 Tejun Heo      2007-12-18  266   */
ce54d161630211 Tejun Heo      2007-12-18  267  static unsigned long nv_mode_filter(struct ata_device *dev,
ce54d161630211 Tejun Heo      2007-12-18  268  				    unsigned long xfer_mask)
ce54d161630211 Tejun Heo      2007-12-18  269  {
ce54d161630211 Tejun Heo      2007-12-18  270  	static const unsigned int udma_mask_map[] =
ce54d161630211 Tejun Heo      2007-12-18  271  		{ ATA_UDMA2, ATA_UDMA1, ATA_UDMA0, 0,
ce54d161630211 Tejun Heo      2007-12-18  272  		  ATA_UDMA3, ATA_UDMA4, ATA_UDMA5, ATA_UDMA6 };
ce54d161630211 Tejun Heo      2007-12-18  273  	struct ata_port *ap = dev->link->ap;
ce54d161630211 Tejun Heo      2007-12-18  274  	char acpi_str[32] = "";
ce54d161630211 Tejun Heo      2007-12-18  275  	u32 saved_udma, udma;
ce54d161630211 Tejun Heo      2007-12-18  276  	const struct ata_acpi_gtm *gtm;
ce54d161630211 Tejun Heo      2007-12-18  277  	unsigned long bios_limit = 0, acpi_limit = 0, limit;
ce54d161630211 Tejun Heo      2007-12-18  278  
ce54d161630211 Tejun Heo      2007-12-18  279  	/* find out what BIOS configured */
ce54d161630211 Tejun Heo      2007-12-18 @280  	udma = saved_udma = (unsigned long)ap->host->private_data;
ce54d161630211 Tejun Heo      2007-12-18  281  
ce54d161630211 Tejun Heo      2007-12-18  282  	if (ap->port_no == 0)
ce54d161630211 Tejun Heo      2007-12-18  283  		udma >>= 16;
ce54d161630211 Tejun Heo      2007-12-18  284  	if (dev->devno == 0)
ce54d161630211 Tejun Heo      2007-12-18  285  		udma >>= 8;
ce54d161630211 Tejun Heo      2007-12-18  286  
ce54d161630211 Tejun Heo      2007-12-18  287  	if ((udma & 0xc0) == 0xc0)
ce54d161630211 Tejun Heo      2007-12-18  288  		bios_limit = ata_pack_xfermask(0, 0, udma_mask_map[udma & 0x7]);
ce54d161630211 Tejun Heo      2007-12-18  289  
ce54d161630211 Tejun Heo      2007-12-18  290  	/* consult ACPI GTM too */
ce54d161630211 Tejun Heo      2007-12-18  291  	gtm = ata_acpi_init_gtm(ap);
ce54d161630211 Tejun Heo      2007-12-18  292  	if (gtm) {
ce54d161630211 Tejun Heo      2007-12-18  293  		acpi_limit = ata_acpi_gtm_xfermask(dev, gtm);
ce54d161630211 Tejun Heo      2007-12-18  294  
ce54d161630211 Tejun Heo      2007-12-18  295  		snprintf(acpi_str, sizeof(acpi_str), " (%u:%u:0x%x)",
ce54d161630211 Tejun Heo      2007-12-18  296  			 gtm->drive[0].dma, gtm->drive[1].dma, gtm->flags);
ce54d161630211 Tejun Heo      2007-12-18  297  	}
ce54d161630211 Tejun Heo      2007-12-18  298  
ce54d161630211 Tejun Heo      2007-12-18  299  	/* be optimistic, EH can take care of things if something goes wrong */
ce54d161630211 Tejun Heo      2007-12-18  300  	limit = bios_limit | acpi_limit;
ce54d161630211 Tejun Heo      2007-12-18  301  
ce54d161630211 Tejun Heo      2007-12-18  302  	/* If PIO or DMA isn't configured at all, don't limit.  Let EH
ce54d161630211 Tejun Heo      2007-12-18  303  	 * handle it.
ce54d161630211 Tejun Heo      2007-12-18  304  	 */
ce54d161630211 Tejun Heo      2007-12-18  305  	if (!(limit & ATA_MASK_PIO))
ce54d161630211 Tejun Heo      2007-12-18  306  		limit |= ATA_MASK_PIO;
ce54d161630211 Tejun Heo      2007-12-18  307  	if (!(limit & (ATA_MASK_MWDMA | ATA_MASK_UDMA)))
ce54d161630211 Tejun Heo      2007-12-18  308  		limit |= ATA_MASK_MWDMA | ATA_MASK_UDMA;
90950a2504b66d Robert Hancock 2009-09-12  309  	/* PIO4, MWDMA2, UDMA2 should always be supported regardless of
90950a2504b66d Robert Hancock 2009-09-12  310  	   cable detection result */
90950a2504b66d Robert Hancock 2009-09-12  311  	limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
ce54d161630211 Tejun Heo      2007-12-18  312  
a9a79dfec23956 Joe Perches    2011-04-15  313  	ata_port_dbg(ap, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
ce54d161630211 Tejun Heo      2007-12-18  314  			"BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",
ce54d161630211 Tejun Heo      2007-12-18  315  			xfer_mask, limit, xfer_mask & limit, bios_limit,
ce54d161630211 Tejun Heo      2007-12-18  316  			saved_udma, acpi_limit, acpi_str);
ce54d161630211 Tejun Heo      2007-12-18  317  
ce54d161630211 Tejun Heo      2007-12-18  318  	return xfer_mask & limit;
ce54d161630211 Tejun Heo      2007-12-18  319  }
669a5db411d85a Jeff Garzik    2006-08-29  320  

:::::: The code at line 280 was first introduced by commit
:::::: ce54d1616302117fa98513ae916bb3333e1c02ea pata_amd: update mode selection for NV PATAs

:::::: TO: Tejun Heo <htejun@gmail.com>
:::::: CC: Jeff Garzik <jeff@garzik.org>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* drivers/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores]
@ 2022-04-12  9:39 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-04-12  9:39 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Hannes Reinecke <hare@suse.de>
CC: Damien Le Moal <damien.lemoal@opensource.wdc.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
commit: 742bef476ca5352b16063161fb73a56629a6d995 ata: libata: move ata_{port,link,dev}_dbg to standard pr_XXX() macros
date:   3 months ago
:::::: branch date: 33 hours ago
:::::: commit date: 3 months ago
config: riscv-randconfig-c006-20220411 (https://download.01.org/0day-ci/archive/20220412/202204121702.NUAEcKdN-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c6e83f560f06cdfe8aa47b248d8bdc58f947274b)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=742bef476ca5352b16063161fb73a56629a6d995
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 742bef476ca5352b16063161fb73a56629a6d995
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
               ^~~
   drivers/media/i2c/ov5647.c:1423:2: note: Taking true branch
           if (ret < 0)
           ^
   drivers/media/i2c/ov5647.c:1424:3: note: Control jumps to line 1440
                   goto power_off;
                   ^
   drivers/media/i2c/ov5647.c:1440:2: note: Calling 'ov5647_power_off'
           ov5647_power_off(dev);
           ^~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov5647.c:798:2: note: 'rdval' declared without an initial value
           u8 rdval;
           ^~~~~~~~
   drivers/media/i2c/ov5647.c:801:2: note: Taking false branch
           dev_dbg(dev, "OV5647 power off\n");
           ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   drivers/media/i2c/ov5647.c:805:6: note: 'ret' is < 0
           if (ret < 0)
               ^~~
   drivers/media/i2c/ov5647.c:805:2: note: Taking true branch
           if (ret < 0)
           ^
   drivers/media/i2c/ov5647.c:806:3: note: Taking false branch
                   dev_dbg(dev, "disable oe failed\n");
                   ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   drivers/media/i2c/ov5647.c:809:8: note: Calling 'ov5647_read'
           ret = ov5647_read(&sensor->sd, OV5647_SW_STANDBY, &rdval);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov5647.c:622:6: note: Assuming 'ret' is < 0
           if (ret < 0) {
               ^~~~~~~
   drivers/media/i2c/ov5647.c:622:2: note: Taking true branch
           if (ret < 0) {
           ^
   drivers/media/i2c/ov5647.c:623:3: note: Taking false branch
                   dev_dbg(&client->dev, "%s: i2c write error, reg: %x\n",
                   ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   drivers/media/i2c/ov5647.c:625:3: note: Returning without writing to '*val'
                   return ret;
                   ^
   drivers/media/i2c/ov5647.c:809:8: note: Returning from 'ov5647_read'
           ret = ov5647_read(&sensor->sd, OV5647_SW_STANDBY, &rdval);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov5647.c:810:6: note: 'ret' is < 0
           if (ret < 0)
               ^~~
   drivers/media/i2c/ov5647.c:810:2: note: Taking true branch
           if (ret < 0)
           ^
   drivers/media/i2c/ov5647.c:811:3: note: Taking false branch
                   dev_dbg(dev, "software standby failed\n");
                   ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   drivers/media/i2c/ov5647.c:813:8: note: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
           rdval &= ~0x01;
           ~~~~~ ^
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   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/ata/sata_sx4.c:1326:8: warning: Although the value stored to 'speed' is used in the enclosing expression, the value is never actually read from 'speed' [clang-analyzer-deadcode.DeadStores]
           if (!(speed = pdc20621_detect_dimm(host))) {
                 ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ata/sata_sx4.c:1326:8: note: Although the value stored to 'speed' is used in the enclosing expression, the value is never actually read from 'speed'
           if (!(speed = pdc20621_detect_dimm(host))) {
                 ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~
   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/ata/pata_ali.c:126:10: warning: Although the value stored to 'mask' is used in the enclosing expression, the value is never actually read from 'mask' [clang-analyzer-deadcode.DeadStores]
                   return mask &= ~ATA_MASK_UDMA;
                          ^       ~~~~~~~~~~~~~~
   drivers/ata/pata_ali.c:126:10: note: Although the value stored to 'mask' is used in the enclosing expression, the value is never actually read from 'mask'
                   return mask &= ~ATA_MASK_UDMA;
                          ^       ~~~~~~~~~~~~~~
   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/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores]
           udma = saved_udma = (unsigned long)ap->host->private_data;
                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ata/pata_amd.c:280:9: note: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma'
           udma = saved_udma = (unsigned long)ap->host->private_data;
                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   drivers/tty/mxser.c:389:7: warning: Although the value stored to 'hwid' is used in the enclosing expression, the value is never actually read from 'hwid' [clang-analyzer-deadcode.DeadStores]
           if ((hwid = inb(io + UART_MCR)) != 0) {
                ^
   drivers/tty/mxser.c:389:7: note: Although the value stored to 'hwid' is used in the enclosing expression, the value is never actually read from 'hwid'
   drivers/tty/mxser.c:1489:12: warning: Although the value stored to 'lsr' is used in the enclosing expression, the value is never actually read from 'lsr' [clang-analyzer-deadcode.DeadStores]
           while (!((lsr = inb(info->ioaddr + UART_LSR)) & UART_LSR_TEMT)) {
                     ^
   drivers/tty/mxser.c:1489:12: note: Although the value stored to 'lsr' is used in the enclosing expression, the value is never actually read from 'lsr'
   drivers/tty/mxser.c:1687:3: warning: Value stored to 'status' is never read [clang-analyzer-deadcode.DeadStores]
                   status = inb(port->ioaddr + UART_LSR);
                   ^
   drivers/tty/mxser.c:1687:3: note: Value stored to 'status' is never read
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   fs/namespace.c:2242:13: warning: Access to field 'd_inode' results in a dereference of a null pointer (loaded from variable 'dentry') [clang-analyzer-core.NullDereference]
           inode_lock(dentry->d_inode);
                      ^
   fs/namespace.c:3816:1: note: Calling '__do_sys_pivot_root'
   SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
   ^
   include/linux/syscalls.h:218:36: note: expanded from macro 'SYSCALL_DEFINE2'
   #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:228:2: note: expanded from macro 'SYSCALL_DEFINEx'
           __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:249:14: note: expanded from macro '__SYSCALL_DEFINEx'
                   long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   note: expanded from here
   fs/namespace.c:3824:6: note: Assuming the condition is false
           if (!may_mount())
               ^~~~~~~~~~~~
   fs/namespace.c:3824:2: note: Taking false branch
           if (!may_mount())
           ^
   fs/namespace.c:3829:6: note: Assuming 'error' is 0

vim +280 drivers/ata/pata_amd.c

669a5db411d85a Jeff Garzik    2006-08-29  260  
ce54d161630211 Tejun Heo      2007-12-18  261  /* Both host-side and drive-side detection results are worthless on NV
ce54d161630211 Tejun Heo      2007-12-18  262   * PATAs.  Ignore them and just follow what BIOS configured.  Both the
ce54d161630211 Tejun Heo      2007-12-18  263   * current configuration in PCI config reg and ACPI GTM result are
ce54d161630211 Tejun Heo      2007-12-18  264   * cached during driver attach and are consulted to select transfer
ce54d161630211 Tejun Heo      2007-12-18  265   * mode.
ce54d161630211 Tejun Heo      2007-12-18  266   */
ce54d161630211 Tejun Heo      2007-12-18  267  static unsigned long nv_mode_filter(struct ata_device *dev,
ce54d161630211 Tejun Heo      2007-12-18  268  				    unsigned long xfer_mask)
ce54d161630211 Tejun Heo      2007-12-18  269  {
ce54d161630211 Tejun Heo      2007-12-18  270  	static const unsigned int udma_mask_map[] =
ce54d161630211 Tejun Heo      2007-12-18  271  		{ ATA_UDMA2, ATA_UDMA1, ATA_UDMA0, 0,
ce54d161630211 Tejun Heo      2007-12-18  272  		  ATA_UDMA3, ATA_UDMA4, ATA_UDMA5, ATA_UDMA6 };
ce54d161630211 Tejun Heo      2007-12-18  273  	struct ata_port *ap = dev->link->ap;
ce54d161630211 Tejun Heo      2007-12-18  274  	char acpi_str[32] = "";
ce54d161630211 Tejun Heo      2007-12-18  275  	u32 saved_udma, udma;
ce54d161630211 Tejun Heo      2007-12-18  276  	const struct ata_acpi_gtm *gtm;
ce54d161630211 Tejun Heo      2007-12-18  277  	unsigned long bios_limit = 0, acpi_limit = 0, limit;
ce54d161630211 Tejun Heo      2007-12-18  278  
ce54d161630211 Tejun Heo      2007-12-18  279  	/* find out what BIOS configured */
ce54d161630211 Tejun Heo      2007-12-18 @280  	udma = saved_udma = (unsigned long)ap->host->private_data;
ce54d161630211 Tejun Heo      2007-12-18  281  
ce54d161630211 Tejun Heo      2007-12-18  282  	if (ap->port_no == 0)
ce54d161630211 Tejun Heo      2007-12-18  283  		udma >>= 16;
ce54d161630211 Tejun Heo      2007-12-18  284  	if (dev->devno == 0)
ce54d161630211 Tejun Heo      2007-12-18  285  		udma >>= 8;
ce54d161630211 Tejun Heo      2007-12-18  286  
ce54d161630211 Tejun Heo      2007-12-18  287  	if ((udma & 0xc0) == 0xc0)
ce54d161630211 Tejun Heo      2007-12-18  288  		bios_limit = ata_pack_xfermask(0, 0, udma_mask_map[udma & 0x7]);
ce54d161630211 Tejun Heo      2007-12-18  289  
ce54d161630211 Tejun Heo      2007-12-18  290  	/* consult ACPI GTM too */
ce54d161630211 Tejun Heo      2007-12-18  291  	gtm = ata_acpi_init_gtm(ap);
ce54d161630211 Tejun Heo      2007-12-18  292  	if (gtm) {
ce54d161630211 Tejun Heo      2007-12-18  293  		acpi_limit = ata_acpi_gtm_xfermask(dev, gtm);
ce54d161630211 Tejun Heo      2007-12-18  294  
ce54d161630211 Tejun Heo      2007-12-18  295  		snprintf(acpi_str, sizeof(acpi_str), " (%u:%u:0x%x)",
ce54d161630211 Tejun Heo      2007-12-18  296  			 gtm->drive[0].dma, gtm->drive[1].dma, gtm->flags);
ce54d161630211 Tejun Heo      2007-12-18  297  	}
ce54d161630211 Tejun Heo      2007-12-18  298  
ce54d161630211 Tejun Heo      2007-12-18  299  	/* be optimistic, EH can take care of things if something goes wrong */
ce54d161630211 Tejun Heo      2007-12-18  300  	limit = bios_limit | acpi_limit;
ce54d161630211 Tejun Heo      2007-12-18  301  
ce54d161630211 Tejun Heo      2007-12-18  302  	/* If PIO or DMA isn't configured at all, don't limit.  Let EH
ce54d161630211 Tejun Heo      2007-12-18  303  	 * handle it.
ce54d161630211 Tejun Heo      2007-12-18  304  	 */
ce54d161630211 Tejun Heo      2007-12-18  305  	if (!(limit & ATA_MASK_PIO))
ce54d161630211 Tejun Heo      2007-12-18  306  		limit |= ATA_MASK_PIO;
ce54d161630211 Tejun Heo      2007-12-18  307  	if (!(limit & (ATA_MASK_MWDMA | ATA_MASK_UDMA)))
ce54d161630211 Tejun Heo      2007-12-18  308  		limit |= ATA_MASK_MWDMA | ATA_MASK_UDMA;
90950a2504b66d Robert Hancock 2009-09-12  309  	/* PIO4, MWDMA2, UDMA2 should always be supported regardless of
90950a2504b66d Robert Hancock 2009-09-12  310  	   cable detection result */
90950a2504b66d Robert Hancock 2009-09-12  311  	limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
ce54d161630211 Tejun Heo      2007-12-18  312  
a9a79dfec23956 Joe Perches    2011-04-15  313  	ata_port_dbg(ap, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
ce54d161630211 Tejun Heo      2007-12-18  314  			"BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",
ce54d161630211 Tejun Heo      2007-12-18  315  			xfer_mask, limit, xfer_mask & limit, bios_limit,
ce54d161630211 Tejun Heo      2007-12-18  316  			saved_udma, acpi_limit, acpi_str);
ce54d161630211 Tejun Heo      2007-12-18  317  
ce54d161630211 Tejun Heo      2007-12-18  318  	return xfer_mask & limit;
ce54d161630211 Tejun Heo      2007-12-18  319  }
669a5db411d85a Jeff Garzik    2006-08-29  320  

:::::: The code at line 280 was first introduced by commit
:::::: ce54d1616302117fa98513ae916bb3333e1c02ea pata_amd: update mode selection for NV PATAs

:::::: TO: Tejun Heo <htejun@gmail.com>
:::::: CC: Jeff Garzik <jeff@garzik.org>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* drivers/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores]
@ 2022-01-27 12:48 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-01-27 12:48 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Hannes Reinecke <hare@suse.de>
CC: Damien Le Moal <damien.lemoal@opensource.wdc.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0280e3c58f92b2fe0e8fbbdf8d386449168de4a8
commit: 742bef476ca5352b16063161fb73a56629a6d995 ata: libata: move ata_{port,link,dev}_dbg to standard pr_XXX() macros
date:   3 weeks ago
:::::: branch date: 2 days ago
:::::: commit date: 3 weeks ago
config: x86_64-randconfig-c007-20220124 (https://download.01.org/0day-ci/archive/20220127/202201272057.UH2JO43i-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7b3d30728816403d1fd73cc5082e9fb761262bce)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=742bef476ca5352b16063161fb73a56629a6d995
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 742bef476ca5352b16063161fb73a56629a6d995
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
           ^
   include/linux/list.h:484:3: note: Calling '__list_splice'
                   __list_splice(list, head, head->next);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/list.h:442:14: note: Use of memory after it is freed
           first->prev = prev;
           ~~~~~~~~~~~ ^
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   drivers/mfd/sm501.c:513:16: warning: Value stored to 'mode' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL);
                         ^~~~
   drivers/mfd/sm501.c:513:16: note: Value stored to 'mode' during its initialization is never read
           unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL);
                         ^~~~
   drivers/mfd/sm501.c:514:16: warning: Value stored to 'gate' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
                         ^~~~
   drivers/mfd/sm501.c:514:16: note: Value stored to 'gate' during its initialization is never read
           unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE);
                         ^~~~
   drivers/mfd/sm501.c:515:16: warning: Value stored to 'clock' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
                         ^~~~~
   drivers/mfd/sm501.c:515:16: note: Value stored to 'clock' during its initialization is never read
           unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK);
                         ^~~~~
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   drivers/ata/sata_sx4.c:1326:8: warning: Although the value stored to 'speed' is used in the enclosing expression, the value is never actually read from 'speed' [clang-analyzer-deadcode.DeadStores]
           if (!(speed = pdc20621_detect_dimm(host))) {
                 ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ata/sata_sx4.c:1326:8: note: Although the value stored to 'speed' is used in the enclosing expression, the value is never actually read from 'speed'
           if (!(speed = pdc20621_detect_dimm(host))) {
                 ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   drivers/ata/pata_ali.c:126:10: warning: Although the value stored to 'mask' is used in the enclosing expression, the value is never actually read from 'mask' [clang-analyzer-deadcode.DeadStores]
                   return mask &= ~ATA_MASK_UDMA;
                          ^       ~~~~~~~~~~~~~~
   drivers/ata/pata_ali.c:126:10: note: Although the value stored to 'mask' is used in the enclosing expression, the value is never actually read from 'mask'
                   return mask &= ~ATA_MASK_UDMA;
                          ^       ~~~~~~~~~~~~~~
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
>> drivers/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores]
           udma = saved_udma = (unsigned long)ap->host->private_data;
                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ata/pata_amd.c:280:9: note: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma'
           udma = saved_udma = (unsigned long)ap->host->private_data;
                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   fs/xfs/libxfs/xfs_da_btree.c:1611:10: warning: Access to field 'b_addr' results in a dereference of a null pointer (loaded from field 'bp') [clang-analyzer-core.NullDereference]
                   curr = blk->bp->b_addr;
                          ^    ~~
   fs/xfs/libxfs/xfs_da_btree.c:1597:2: note: Loop condition is true.  Entering loop body
           for (blk = &state->path.blk[0], state->path.active = 1;
           ^
   fs/xfs/libxfs/xfs_da_btree.c:1604:11: note: Calling 'xfs_da3_node_read'
                   error = xfs_da3_node_read(args->trans, args->dp, blkno,
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_da_btree.c:378:10: note: Calling 'xfs_da_read_buf'
           error = xfs_da_read_buf(tp, dp, bno, 0, bpp, whichfork,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_da_btree.c:2632:2: note: Null pointer value stored to field 'bp'
           *bpp = NULL;
           ^~~~~~~~~~~
   fs/xfs/libxfs/xfs_da_btree.c:2634:6: note: Assuming 'error' is 0, which participates in a condition later
           if (error || !nmap)
               ^~~~~
   fs/xfs/libxfs/xfs_da_btree.c:2634:6: note: Left side of '||' is false
   fs/xfs/libxfs/xfs_da_btree.c:2634:15: note: Assuming 'nmap' is 0
           if (error || !nmap)
                        ^~~~~
   fs/xfs/libxfs/xfs_da_btree.c:2634:2: note: Taking true branch
           if (error || !nmap)
           ^
   fs/xfs/libxfs/xfs_da_btree.c:2635:3: note: Control jumps to line 2648
                   goto out_free;
                   ^
   fs/xfs/libxfs/xfs_da_btree.c:2648:2: note: Taking true branch
           if (mapp != &map)
           ^
   fs/xfs/libxfs/xfs_da_btree.c:2651:2: note: Returning zero (loaded from 'error'), which participates in a condition later
           return error;
           ^~~~~~~~~~~~
   fs/xfs/libxfs/xfs_da_btree.c:378:10: note: Returning from 'xfs_da_read_buf'
           error = xfs_da_read_buf(tp, dp, bno, 0, bpp, whichfork,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_da_btree.c:380:6: note: 'error' is 0
           if (error || !*bpp || !tp)
               ^~~~~
   fs/xfs/libxfs/xfs_da_btree.c:380:6: note: Left side of '||' is false
   fs/xfs/libxfs/xfs_da_btree.c:380:21: note: Left side of '||' is true
           if (error || !*bpp || !tp)
                              ^
   fs/xfs/libxfs/xfs_da_btree.c:381:3: note: Returning zero (loaded from 'error'), which participates in a condition later
                   return error;
                   ^~~~~~~~~~~~
   fs/xfs/libxfs/xfs_da_btree.c:1604:11: note: Returning from 'xfs_da3_node_read'
                   error = xfs_da3_node_read(args->trans, args->dp, blkno,
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_da_btree.c:1606:7: note: 'error' is 0
                   if (error) {
                       ^~~~~
   fs/xfs/libxfs/xfs_da_btree.c:1606:3: note: Taking false branch
                   if (error) {
                   ^
   fs/xfs/libxfs/xfs_da_btree.c:1611:10: note: Access to field 'b_addr' results in a dereference of a null pointer (loaded from field 'bp')
                   curr = blk->bp->b_addr;
                          ^    ~~
   fs/xfs/libxfs/xfs_da_btree.c:2203:22: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
           if (got != count || mapp[0].br_startoff != *bno ||
                               ^~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_da_btree.c:2153:6: note: Assuming 'error' is 0
           if (error)
               ^~~~~
   fs/xfs/libxfs/xfs_da_btree.c:2153:2: note: Taking false branch
           if (error)
           ^
   fs/xfs/libxfs/xfs_da_btree.c:2163:6: note: Assuming 'error' is 0
           if (error)
               ^~~~~
   fs/xfs/libxfs/xfs_da_btree.c:2163:2: note: Taking false branch
           if (error)
           ^
   fs/xfs/libxfs/xfs_da_btree.c:2166:9: note: Assuming 'nmap' is <= 1
           ASSERT(nmap <= 1);
                  ^
   fs/xfs/xfs_linux.h:214:10: note: expanded from macro 'ASSERT'
           (likely(expr) ? (void)0 : asswarn(NULL, #expr, __FILE__, __LINE__))
                   ^~~~

vim +280 drivers/ata/pata_amd.c

669a5db411d85a1 Jeff Garzik    2006-08-29  260  
ce54d1616302117 Tejun Heo      2007-12-18  261  /* Both host-side and drive-side detection results are worthless on NV
ce54d1616302117 Tejun Heo      2007-12-18  262   * PATAs.  Ignore them and just follow what BIOS configured.  Both the
ce54d1616302117 Tejun Heo      2007-12-18  263   * current configuration in PCI config reg and ACPI GTM result are
ce54d1616302117 Tejun Heo      2007-12-18  264   * cached during driver attach and are consulted to select transfer
ce54d1616302117 Tejun Heo      2007-12-18  265   * mode.
ce54d1616302117 Tejun Heo      2007-12-18  266   */
ce54d1616302117 Tejun Heo      2007-12-18  267  static unsigned long nv_mode_filter(struct ata_device *dev,
ce54d1616302117 Tejun Heo      2007-12-18  268  				    unsigned long xfer_mask)
ce54d1616302117 Tejun Heo      2007-12-18  269  {
ce54d1616302117 Tejun Heo      2007-12-18  270  	static const unsigned int udma_mask_map[] =
ce54d1616302117 Tejun Heo      2007-12-18  271  		{ ATA_UDMA2, ATA_UDMA1, ATA_UDMA0, 0,
ce54d1616302117 Tejun Heo      2007-12-18  272  		  ATA_UDMA3, ATA_UDMA4, ATA_UDMA5, ATA_UDMA6 };
ce54d1616302117 Tejun Heo      2007-12-18  273  	struct ata_port *ap = dev->link->ap;
ce54d1616302117 Tejun Heo      2007-12-18  274  	char acpi_str[32] = "";
ce54d1616302117 Tejun Heo      2007-12-18  275  	u32 saved_udma, udma;
ce54d1616302117 Tejun Heo      2007-12-18  276  	const struct ata_acpi_gtm *gtm;
ce54d1616302117 Tejun Heo      2007-12-18  277  	unsigned long bios_limit = 0, acpi_limit = 0, limit;
ce54d1616302117 Tejun Heo      2007-12-18  278  
ce54d1616302117 Tejun Heo      2007-12-18  279  	/* find out what BIOS configured */
ce54d1616302117 Tejun Heo      2007-12-18 @280  	udma = saved_udma = (unsigned long)ap->host->private_data;
ce54d1616302117 Tejun Heo      2007-12-18  281  
ce54d1616302117 Tejun Heo      2007-12-18  282  	if (ap->port_no == 0)
ce54d1616302117 Tejun Heo      2007-12-18  283  		udma >>= 16;
ce54d1616302117 Tejun Heo      2007-12-18  284  	if (dev->devno == 0)
ce54d1616302117 Tejun Heo      2007-12-18  285  		udma >>= 8;
ce54d1616302117 Tejun Heo      2007-12-18  286  
ce54d1616302117 Tejun Heo      2007-12-18  287  	if ((udma & 0xc0) == 0xc0)
ce54d1616302117 Tejun Heo      2007-12-18  288  		bios_limit = ata_pack_xfermask(0, 0, udma_mask_map[udma & 0x7]);
ce54d1616302117 Tejun Heo      2007-12-18  289  
ce54d1616302117 Tejun Heo      2007-12-18  290  	/* consult ACPI GTM too */
ce54d1616302117 Tejun Heo      2007-12-18  291  	gtm = ata_acpi_init_gtm(ap);
ce54d1616302117 Tejun Heo      2007-12-18  292  	if (gtm) {
ce54d1616302117 Tejun Heo      2007-12-18  293  		acpi_limit = ata_acpi_gtm_xfermask(dev, gtm);
ce54d1616302117 Tejun Heo      2007-12-18  294  
ce54d1616302117 Tejun Heo      2007-12-18  295  		snprintf(acpi_str, sizeof(acpi_str), " (%u:%u:0x%x)",
ce54d1616302117 Tejun Heo      2007-12-18  296  			 gtm->drive[0].dma, gtm->drive[1].dma, gtm->flags);
ce54d1616302117 Tejun Heo      2007-12-18  297  	}
ce54d1616302117 Tejun Heo      2007-12-18  298  
ce54d1616302117 Tejun Heo      2007-12-18  299  	/* be optimistic, EH can take care of things if something goes wrong */
ce54d1616302117 Tejun Heo      2007-12-18  300  	limit = bios_limit | acpi_limit;
ce54d1616302117 Tejun Heo      2007-12-18  301  
ce54d1616302117 Tejun Heo      2007-12-18  302  	/* If PIO or DMA isn't configured at all, don't limit.  Let EH
ce54d1616302117 Tejun Heo      2007-12-18  303  	 * handle it.
ce54d1616302117 Tejun Heo      2007-12-18  304  	 */
ce54d1616302117 Tejun Heo      2007-12-18  305  	if (!(limit & ATA_MASK_PIO))
ce54d1616302117 Tejun Heo      2007-12-18  306  		limit |= ATA_MASK_PIO;
ce54d1616302117 Tejun Heo      2007-12-18  307  	if (!(limit & (ATA_MASK_MWDMA | ATA_MASK_UDMA)))
ce54d1616302117 Tejun Heo      2007-12-18  308  		limit |= ATA_MASK_MWDMA | ATA_MASK_UDMA;
90950a2504b66d6 Robert Hancock 2009-09-12  309  	/* PIO4, MWDMA2, UDMA2 should always be supported regardless of
90950a2504b66d6 Robert Hancock 2009-09-12  310  	   cable detection result */
90950a2504b66d6 Robert Hancock 2009-09-12  311  	limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
ce54d1616302117 Tejun Heo      2007-12-18  312  
a9a79dfec239568 Joe Perches    2011-04-15  313  	ata_port_dbg(ap, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
ce54d1616302117 Tejun Heo      2007-12-18  314  			"BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",
ce54d1616302117 Tejun Heo      2007-12-18  315  			xfer_mask, limit, xfer_mask & limit, bios_limit,
ce54d1616302117 Tejun Heo      2007-12-18  316  			saved_udma, acpi_limit, acpi_str);
ce54d1616302117 Tejun Heo      2007-12-18  317  
ce54d1616302117 Tejun Heo      2007-12-18  318  	return xfer_mask & limit;
ce54d1616302117 Tejun Heo      2007-12-18  319  }
669a5db411d85a1 Jeff Garzik    2006-08-29  320  

:::::: The code at line 280 was first introduced by commit
:::::: ce54d1616302117fa98513ae916bb3333e1c02ea pata_amd: update mode selection for NV PATAs

:::::: TO: Tejun Heo <htejun@gmail.com>
:::::: CC: Jeff Garzik <jeff@garzik.org>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* drivers/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores]
@ 2022-01-25  0:26 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-01-25  0:26 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Hannes Reinecke <hare@suse.de>
CC: Damien Le Moal <damien.lemoal@opensource.wdc.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 742bef476ca5352b16063161fb73a56629a6d995 ata: libata: move ata_{port,link,dev}_dbg to standard pr_XXX() macros
date:   3 weeks ago
:::::: branch date: 31 hours ago
:::::: commit date: 3 weeks ago
config: x86_64-randconfig-c007-20220124 (https://download.01.org/0day-ci/archive/20220125/202201250743.p1jyEhJ8-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7b3d30728816403d1fd73cc5082e9fb761262bce)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=742bef476ca5352b16063161fb73a56629a6d995
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 742bef476ca5352b16063161fb73a56629a6d995
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   drivers/ata/pata_ali.c:126:10: warning: Although the value stored to 'mask' is used in the enclosing expression, the value is never actually read from 'mask' [clang-analyzer-deadcode.DeadStores]
                   return mask &= ~ATA_MASK_UDMA;
                          ^       ~~~~~~~~~~~~~~
   drivers/ata/pata_ali.c:126:10: note: Although the value stored to 'mask' is used in the enclosing expression, the value is never actually read from 'mask'
                   return mask &= ~ATA_MASK_UDMA;
                          ^       ~~~~~~~~~~~~~~
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
>> drivers/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores]
           udma = saved_udma = (unsigned long)ap->host->private_data;
                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/ata/pata_amd.c:280:9: note: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma'
           udma = saved_udma = (unsigned long)ap->host->private_data;
                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (1 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   drivers/input/joystick/a3d.c:94:44: warning: The left operand of '<<' is a garbage value due to array index out of bounds [clang-analyzer-core.UndefinedBinaryOperatorResult]
           return (csum & 0x3f) != ((data[count - 2] << 3) | data[count - 1]);
                                                     ^
   drivers/input/joystick/a3d.c:257:6: note: Assuming 'a3d' is non-null
           if (!a3d || !input_dev) {
               ^~~~
   drivers/input/joystick/a3d.c:257:6: note: Left side of '||' is false
   drivers/input/joystick/a3d.c:257:14: note: Assuming 'input_dev' is non-null
           if (!a3d || !input_dev) {
                       ^~~~~~~~~~
   drivers/input/joystick/a3d.c:257:2: note: Taking false branch

vim +280 drivers/ata/pata_amd.c

669a5db411d85a Jeff Garzik    2006-08-29  260  
ce54d161630211 Tejun Heo      2007-12-18  261  /* Both host-side and drive-side detection results are worthless on NV
ce54d161630211 Tejun Heo      2007-12-18  262   * PATAs.  Ignore them and just follow what BIOS configured.  Both the
ce54d161630211 Tejun Heo      2007-12-18  263   * current configuration in PCI config reg and ACPI GTM result are
ce54d161630211 Tejun Heo      2007-12-18  264   * cached during driver attach and are consulted to select transfer
ce54d161630211 Tejun Heo      2007-12-18  265   * mode.
ce54d161630211 Tejun Heo      2007-12-18  266   */
ce54d161630211 Tejun Heo      2007-12-18  267  static unsigned long nv_mode_filter(struct ata_device *dev,
ce54d161630211 Tejun Heo      2007-12-18  268  				    unsigned long xfer_mask)
ce54d161630211 Tejun Heo      2007-12-18  269  {
ce54d161630211 Tejun Heo      2007-12-18  270  	static const unsigned int udma_mask_map[] =
ce54d161630211 Tejun Heo      2007-12-18  271  		{ ATA_UDMA2, ATA_UDMA1, ATA_UDMA0, 0,
ce54d161630211 Tejun Heo      2007-12-18  272  		  ATA_UDMA3, ATA_UDMA4, ATA_UDMA5, ATA_UDMA6 };
ce54d161630211 Tejun Heo      2007-12-18  273  	struct ata_port *ap = dev->link->ap;
ce54d161630211 Tejun Heo      2007-12-18  274  	char acpi_str[32] = "";
ce54d161630211 Tejun Heo      2007-12-18  275  	u32 saved_udma, udma;
ce54d161630211 Tejun Heo      2007-12-18  276  	const struct ata_acpi_gtm *gtm;
ce54d161630211 Tejun Heo      2007-12-18  277  	unsigned long bios_limit = 0, acpi_limit = 0, limit;
ce54d161630211 Tejun Heo      2007-12-18  278  
ce54d161630211 Tejun Heo      2007-12-18  279  	/* find out what BIOS configured */
ce54d161630211 Tejun Heo      2007-12-18 @280  	udma = saved_udma = (unsigned long)ap->host->private_data;
ce54d161630211 Tejun Heo      2007-12-18  281  
ce54d161630211 Tejun Heo      2007-12-18  282  	if (ap->port_no == 0)
ce54d161630211 Tejun Heo      2007-12-18  283  		udma >>= 16;
ce54d161630211 Tejun Heo      2007-12-18  284  	if (dev->devno == 0)
ce54d161630211 Tejun Heo      2007-12-18  285  		udma >>= 8;
ce54d161630211 Tejun Heo      2007-12-18  286  
ce54d161630211 Tejun Heo      2007-12-18  287  	if ((udma & 0xc0) == 0xc0)
ce54d161630211 Tejun Heo      2007-12-18  288  		bios_limit = ata_pack_xfermask(0, 0, udma_mask_map[udma & 0x7]);
ce54d161630211 Tejun Heo      2007-12-18  289  
ce54d161630211 Tejun Heo      2007-12-18  290  	/* consult ACPI GTM too */
ce54d161630211 Tejun Heo      2007-12-18  291  	gtm = ata_acpi_init_gtm(ap);
ce54d161630211 Tejun Heo      2007-12-18  292  	if (gtm) {
ce54d161630211 Tejun Heo      2007-12-18  293  		acpi_limit = ata_acpi_gtm_xfermask(dev, gtm);
ce54d161630211 Tejun Heo      2007-12-18  294  
ce54d161630211 Tejun Heo      2007-12-18  295  		snprintf(acpi_str, sizeof(acpi_str), " (%u:%u:0x%x)",
ce54d161630211 Tejun Heo      2007-12-18  296  			 gtm->drive[0].dma, gtm->drive[1].dma, gtm->flags);
ce54d161630211 Tejun Heo      2007-12-18  297  	}
ce54d161630211 Tejun Heo      2007-12-18  298  
ce54d161630211 Tejun Heo      2007-12-18  299  	/* be optimistic, EH can take care of things if something goes wrong */
ce54d161630211 Tejun Heo      2007-12-18  300  	limit = bios_limit | acpi_limit;
ce54d161630211 Tejun Heo      2007-12-18  301  
ce54d161630211 Tejun Heo      2007-12-18  302  	/* If PIO or DMA isn't configured at all, don't limit.  Let EH
ce54d161630211 Tejun Heo      2007-12-18  303  	 * handle it.
ce54d161630211 Tejun Heo      2007-12-18  304  	 */
ce54d161630211 Tejun Heo      2007-12-18  305  	if (!(limit & ATA_MASK_PIO))
ce54d161630211 Tejun Heo      2007-12-18  306  		limit |= ATA_MASK_PIO;
ce54d161630211 Tejun Heo      2007-12-18  307  	if (!(limit & (ATA_MASK_MWDMA | ATA_MASK_UDMA)))
ce54d161630211 Tejun Heo      2007-12-18  308  		limit |= ATA_MASK_MWDMA | ATA_MASK_UDMA;
90950a2504b66d Robert Hancock 2009-09-12  309  	/* PIO4, MWDMA2, UDMA2 should always be supported regardless of
90950a2504b66d Robert Hancock 2009-09-12  310  	   cable detection result */
90950a2504b66d Robert Hancock 2009-09-12  311  	limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
ce54d161630211 Tejun Heo      2007-12-18  312  
a9a79dfec23956 Joe Perches    2011-04-15  313  	ata_port_dbg(ap, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
ce54d161630211 Tejun Heo      2007-12-18  314  			"BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",
ce54d161630211 Tejun Heo      2007-12-18  315  			xfer_mask, limit, xfer_mask & limit, bios_limit,
ce54d161630211 Tejun Heo      2007-12-18  316  			saved_udma, acpi_limit, acpi_str);
ce54d161630211 Tejun Heo      2007-12-18  317  
ce54d161630211 Tejun Heo      2007-12-18  318  	return xfer_mask & limit;
ce54d161630211 Tejun Heo      2007-12-18  319  }
669a5db411d85a Jeff Garzik    2006-08-29  320  

:::::: The code at line 280 was first introduced by commit
:::::: ce54d1616302117fa98513ae916bb3333e1c02ea pata_amd: update mode selection for NV PATAs

:::::: TO: Tejun Heo <htejun@gmail.com>
:::::: CC: Jeff Garzik <jeff@garzik.org>

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

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

end of thread, other threads:[~2022-04-12  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-27 10:51 drivers/ata/pata_amd.c:280:9: warning: Although the value stored to 'saved_udma' is used in the enclosing expression, the value is never actually read from 'saved_udma' [clang-analyzer-deadcode.DeadStores] kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-04-12  9:39 kernel test robot
2022-01-27 12:48 kernel test robot
2022-01-25  0:26 kernel test robot

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