CC: [email protected] CC: [email protected] CC: [email protected] TO: Hannes Reinecke <[email protected]> CC: Damien Le Moal <[email protected]>
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/[email protected]/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 <[email protected]> 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 <[email protected]> :::::: CC: Jeff Garzik <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected] _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
