All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-linux-intel-lts:5.4/yocto 192/8941] drivers/net/ethernet/stmicro/stmmac/hwif.c:287:43: warning: the omitted middle operand in will always be 'true', suggest explicit middle operand
@ 2020-07-31  7:58 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-07-31  7:58 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/intel/linux-intel-lts.git 5.4/yocto
head:   0194b1072920957ee8a7abdfb3ddebee69c1d485
commit: 41e55459e543de8850eff28ca732757370cd5da5 [192/8941] net: stmmac: Add support for MDIO interrupts
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
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
        git checkout 41e55459e543de8850eff28ca732757370cd5da5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

All warnings (new ones prefixed by >>):

   In file included from arch/m68k/include/asm/io_mm.h:25,
                    from arch/m68k/include/asm/io.h:8,
                    from include/linux/scatterlist.h:9,
                    from include/linux/dma-mapping.h:11,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/net/ethernet/stmicro/stmmac/common.h:14,
                    from drivers/net/ethernet/stmicro/stmmac/hwif.c:7:
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsb':
   arch/m68k/include/asm/raw_io.h:83:7: warning: variable '__w' set but not used [-Wunused-but-set-variable]
      83 |  ({u8 __w, __v = (b);  u32 _addr = ((u32) (addr)); \
         |       ^~~
   arch/m68k/include/asm/raw_io.h:430:3: note: in expansion of macro 'rom_out_8'
     430 |   rom_out_8(port, *buf++);
         |   ^~~~~~~~~
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw':
   arch/m68k/include/asm/raw_io.h:86:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
      86 |  ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
         |        ^~~
   arch/m68k/include/asm/raw_io.h:448:3: note: in expansion of macro 'rom_out_be16'
     448 |   rom_out_be16(port, *buf++);
         |   ^~~~~~~~~~~~
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw_swapw':
   arch/m68k/include/asm/raw_io.h:90:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
      90 |  ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
         |        ^~~
   arch/m68k/include/asm/raw_io.h:466:3: note: in expansion of macro 'rom_out_le16'
     466 |   rom_out_le16(port, *buf++);
         |   ^~~~~~~~~~~~
   In file included from include/linux/kernel.h:11,
                    from include/linux/skbuff.h:13,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/net/ethernet/stmicro/stmmac/common.h:14,
                    from drivers/net/ethernet/stmicro/stmmac/hwif.c:7:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/m68k/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/skbuff.h:15,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/net/ethernet/stmicro/stmmac/common.h:14,
                    from drivers/net/ethernet/stmicro/stmmac/hwif.c:7:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
     139 |  int __ret_warn_once = !!(condition);   \
         |                           ^~~~~~~~~
   arch/m68k/include/asm/page_mm.h:170:25: note: in expansion of macro 'virt_addr_valid'
     170 | #define pfn_valid(pfn)  virt_addr_valid(pfn_to_virt(pfn))
         |                         ^~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:355:19: note: in expansion of macro 'pfn_valid'
     355 |  if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
         |                   ^~~~~~~~~
   drivers/net/ethernet/stmicro/stmmac/hwif.c: In function 'stmmac_hwif_init':
>> drivers/net/ethernet/stmicro/stmmac/hwif.c:287:43: warning: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Wparentheses]
     287 |   mac->mdio_intr_en = mac->mdio_intr_en ? : entry->mdio_intr_en;
         |                                           ^

vim +/true +287 drivers/net/ethernet/stmicro/stmmac/hwif.c

   225	
   226	int stmmac_hwif_init(struct stmmac_priv *priv)
   227	{
   228		bool needs_xgmac = priv->plat->has_xgmac;
   229		bool needs_gmac4 = priv->plat->has_gmac4;
   230		bool needs_gmac = priv->plat->has_gmac;
   231		const struct stmmac_hwif_entry *entry;
   232		struct mac_device_info *mac;
   233		bool needs_setup = true;
   234		int i, ret;
   235		u32 id;
   236	
   237		if (needs_gmac) {
   238			id = stmmac_get_id(priv, GMAC_VERSION);
   239		} else if (needs_gmac4 || needs_xgmac) {
   240			id = stmmac_get_id(priv, GMAC4_VERSION);
   241		} else {
   242			id = 0;
   243		}
   244	
   245		/* Save ID for later use */
   246		priv->synopsys_id = id;
   247	
   248		/* Lets assume some safe values first */
   249		priv->ptpaddr = priv->ioaddr +
   250			(needs_gmac4 ? PTP_GMAC4_OFFSET : PTP_GMAC3_X_OFFSET);
   251		priv->mmcaddr = priv->ioaddr +
   252			(needs_gmac4 ? MMC_GMAC4_OFFSET : MMC_GMAC3_X_OFFSET);
   253	
   254		/* Check for HW specific setup first */
   255		if (priv->plat->setup) {
   256			mac = priv->plat->setup(priv);
   257			needs_setup = false;
   258		} else {
   259			mac = devm_kzalloc(priv->device, sizeof(*mac), GFP_KERNEL);
   260		}
   261	
   262		if (!mac)
   263			return -ENOMEM;
   264	
   265		/* Fallback to generic HW */
   266		for (i = ARRAY_SIZE(stmmac_hw) - 1; i >= 0; i--) {
   267			entry = &stmmac_hw[i];
   268	
   269			if (needs_gmac ^ entry->gmac)
   270				continue;
   271			if (needs_gmac4 ^ entry->gmac4)
   272				continue;
   273			if (needs_xgmac ^ entry->xgmac)
   274				continue;
   275			/* Use synopsys_id var because some setups can override this */
   276			if (priv->synopsys_id < entry->min_id)
   277				continue;
   278	
   279			/* Only use generic HW helpers if needed */
   280			mac->desc = mac->desc ? : entry->desc;
   281			mac->dma = mac->dma ? : entry->dma;
   282			mac->mac = mac->mac ? : entry->mac;
   283			mac->ptp = mac->ptp ? : entry->hwtimestamp;
   284			mac->mode = mac->mode ? : entry->mode;
   285			mac->tc = mac->tc ? : entry->tc;
   286			mac->mmc = mac->mmc ? : entry->mmc;
 > 287			mac->mdio_intr_en = mac->mdio_intr_en ? : entry->mdio_intr_en;

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

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-31  7:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  7:58 [intel-linux-intel-lts:5.4/yocto 192/8941] drivers/net/ethernet/stmicro/stmmac/hwif.c:287:43: warning: the omitted middle operand in will always be 'true', suggest explicit middle operand 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.