[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211011707.MQ9gz37o-lkp@intel.com>
Date: Tue, 1 Nov 2022 17:35:39 +0800
From: kernel test robot <lkp@...el.com>
To: Zhang Changzhong <zhangchangzhong@...wei.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Jeff Garzik <jgarzik@...ox.com>,
Finn Thain <fthain@...ux-m68k.org>
Cc: oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org,
Zhang Changzhong <zhangchangzhong@...wei.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net/sonic: use dma_mapping_error() for error check
Hi Zhang,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net/master]
url: https://github.com/intel-lab-lkp/linux/commits/Zhang-Changzhong/net-sonic-use-dma_mapping_error-for-error-check/20221031-204340
patch link: https://lore.kernel.org/r/1667221322-8317-1-git-send-email-zhangchangzhong%40huawei.com
patch subject: [PATCH net] net/sonic: use dma_mapping_error() for error check
config: m68k-defconfig
compiler: m68k-linux-gcc (GCC) 12.1.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
# https://github.com/intel-lab-lkp/linux/commit/837273d17ba29bbc661c5c82432e83ce4198200a
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Zhang-Changzhong/net-sonic-use-dma_mapping_error-for-error-check/20221031-204340
git checkout 837273d17ba29bbc661c5c82432e83ce4198200a
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
In file included from drivers/net/ethernet/natsemi/macsonic.c:533:
drivers/net/ethernet/natsemi/sonic.c: In function 'sonic_send_packet':
drivers/net/ethernet/natsemi/sonic.c:295:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
295 | if (dma_mapping_error(lp->device, laddr))
| ^~
drivers/net/ethernet/natsemi/sonic.c:297:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
297 | dev_kfree_skb_any(skb);
| ^~~~~~~~~~~~~~~~~
drivers/net/ethernet/natsemi/sonic.c:279:23: warning: unused variable 'flags' [-Wunused-variable]
279 | unsigned long flags;
| ^~~~~
drivers/net/ethernet/natsemi/sonic.c:278:13: warning: unused variable 'entry' [-Wunused-variable]
278 | int entry;
| ^~~~~
In file included from include/linux/kref.h:16,
from include/linux/mm_types.h:8,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from drivers/net/ethernet/natsemi/macsonic.c:36:
drivers/net/ethernet/natsemi/sonic.c: At top level:
include/linux/spinlock.h:379:1: error: expected identifier or '(' before 'do'
379 | do { \
| ^~
drivers/net/ethernet/natsemi/sonic.c:301:9: note: in expansion of macro 'spin_lock_irqsave'
301 | spin_lock_irqsave(&lp->lock, flags);
| ^~~~~~~~~~~~~~~~~
include/linux/spinlock.h:381:3: error: expected identifier or '(' before 'while'
381 | } while (0)
| ^~~~~
drivers/net/ethernet/natsemi/sonic.c:301:9: note: in expansion of macro 'spin_lock_irqsave'
301 | spin_lock_irqsave(&lp->lock, flags);
| ^~~~~~~~~~~~~~~~~
drivers/net/ethernet/natsemi/sonic.c:303:9: warning: data definition has no type or storage class
303 | entry = (lp->eol_tx + 1) & SONIC_TDS_MASK;
| ^~~~~
drivers/net/ethernet/natsemi/sonic.c:303:9: error: type defaults to 'int' in declaration of 'entry' [-Werror=implicit-int]
drivers/net/ethernet/natsemi/sonic.c:303:18: error: 'lp' undeclared here (not in a function); did you mean 'up'?
303 | entry = (lp->eol_tx + 1) & SONIC_TDS_MASK;
| ^~
| up
drivers/net/ethernet/natsemi/sonic.c:305:34: error: expected ')' before numeric constant
305 | sonic_tda_put(dev, entry, SONIC_TD_STATUS, 0); /* clear status */
| ^
| )
drivers/net/ethernet/natsemi/sonic.c:306:34: error: expected ')' before numeric constant
306 | sonic_tda_put(dev, entry, SONIC_TD_FRAG_COUNT, 1); /* single fragment */
| ^
| )
drivers/net/ethernet/natsemi/sonic.c:307:34: error: expected ')' before numeric constant
307 | sonic_tda_put(dev, entry, SONIC_TD_PKTSIZE, length); /* length of packet */
| ^
| )
drivers/net/ethernet/natsemi/sonic.c:308:34: error: expected ')' before numeric constant
308 | sonic_tda_put(dev, entry, SONIC_TD_FRAG_PTR_L, laddr & 0xffff);
| ^
| )
drivers/net/ethernet/natsemi/sonic.c:309:34: error: expected ')' before numeric constant
309 | sonic_tda_put(dev, entry, SONIC_TD_FRAG_PTR_H, laddr >> 16);
| ^
| )
drivers/net/ethernet/natsemi/sonic.c:310:34: error: expected ')' before numeric constant
310 | sonic_tda_put(dev, entry, SONIC_TD_FRAG_SIZE, length);
| ^
| )
drivers/net/ethernet/natsemi/sonic.c:311:34: error: expected ')' before numeric constant
311 | sonic_tda_put(dev, entry, SONIC_TD_LINK,
| ^
| )
drivers/net/ethernet/natsemi/sonic.c:314:30: error: expected ')' before '->' token
314 | sonic_tda_put(dev, lp->eol_tx, SONIC_TD_LINK, ~SONIC_EOL &
| ^~
| )
In file included from include/linux/skbuff.h:45,
from include/net/net_namespace.h:43,
from include/linux/netdevice.h:38,
from drivers/net/ethernet/natsemi/macsonic.c:47:
>> include/net/net_debug.h:123:2: error: expected identifier or '(' before '{' token
123 | ({ \
| ^
drivers/net/ethernet/natsemi/sonic.c:317:9: note: in expansion of macro 'netif_dbg'
317 | netif_dbg(lp, tx_queued, dev, "%s: issuing Tx command\n", __func__);
| ^~~~~~~~~
In file included from arch/m68k/include/asm/io_mm.h:25,
from arch/m68k/include/asm/io.h:8,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from include/asm-generic/hardirq.h:17,
from ./arch/m68k/include/generated/asm/hardirq.h:1,
from include/linux/hardirq.h:11,
from include/linux/interrupt.h:11,
from drivers/net/ethernet/natsemi/macsonic.c:40:
arch/m68k/include/asm/raw_io.h:31:27: error: expected identifier or '(' before 'void'
31 | #define out_be16(addr,w) (void)((*(__force volatile u16 *) (unsigned long)(addr)) = (w))
| ^~~~
arch/m68k/include/asm/raw_io.h:44:28: note: in expansion of macro 'out_be16'
44 | #define raw_outw(val,port) out_be16((port),(val))
| ^~~~~~~~
arch/m68k/include/asm/nubus.h:13:22: note: in expansion of macro 'raw_outw'
13 | #define nubus_writew raw_outw
| ^~~~~~~~
drivers/net/ethernet/natsemi/macsonic.c:70:31: note: in expansion of macro 'nubus_writew'
70 | #define SONIC_WRITE(reg,val) (nubus_writew(val, dev->base_addr + (reg * 4) \
| ^~~~~~~~~~~~
drivers/net/ethernet/natsemi/sonic.c:319:9: note: in expansion of macro 'SONIC_WRITE'
319 | SONIC_WRITE(SONIC_CMD, SONIC_CR_TXP);
| ^~~~~~~~~~~
arch/m68k/include/asm/raw_io.h:31:32: error: expected ')' before '(' token
31 | #define out_be16(addr,w) (void)((*(__force volatile u16 *) (unsigned long)(addr)) = (w))
| ^
arch/m68k/include/asm/raw_io.h:44:28: note: in expansion of macro 'out_be16'
44 | #define raw_outw(val,port) out_be16((port),(val))
| ^~~~~~~~
arch/m68k/include/asm/nubus.h:13:22: note: in expansion of macro 'raw_outw'
13 | #define nubus_writew raw_outw
| ^~~~~~~~
drivers/net/ethernet/natsemi/macsonic.c:70:31: note: in expansion of macro 'nubus_writew'
70 | #define SONIC_WRITE(reg,val) (nubus_writew(val, dev->base_addr + (reg * 4) \
| ^~~~~~~~~~~~
drivers/net/ethernet/natsemi/sonic.c:319:9: note: in expansion of macro 'SONIC_WRITE'
319 | SONIC_WRITE(SONIC_CMD, SONIC_CR_TXP);
| ^~~~~~~~~~~
drivers/net/ethernet/natsemi/sonic.c:321:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
321 | lp->tx_len[entry] = length;
| ^~
drivers/net/ethernet/natsemi/sonic.c:322:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
322 | lp->tx_laddr[entry] = laddr;
| ^~
drivers/net/ethernet/natsemi/sonic.c:323:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
323 | lp->tx_skb[entry] = skb;
| ^~
drivers/net/ethernet/natsemi/sonic.c:325:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
325 | lp->eol_tx = entry;
| ^~
drivers/net/ethernet/natsemi/sonic.c:327:9: warning: data definition has no type or storage class
327 | entry = (entry + 1) & SONIC_TDS_MASK;
| ^~~~~
drivers/net/ethernet/natsemi/sonic.c:327:9: error: type defaults to 'int' in declaration of 'entry' [-Werror=implicit-int]
drivers/net/ethernet/natsemi/sonic.c:327:9: error: redefinition of 'entry'
drivers/net/ethernet/natsemi/sonic.c:303:9: note: previous definition of 'entry' with type 'int'
303 | entry = (lp->eol_tx + 1) & SONIC_TDS_MASK;
| ^~~~~
drivers/net/ethernet/natsemi/sonic.c:327:17: error: initializer element is not constant
327 | entry = (entry + 1) & SONIC_TDS_MASK;
| ^
drivers/net/ethernet/natsemi/sonic.c:328:9: error: expected identifier or '(' before 'if'
328 | if (lp->tx_skb[entry]) {
| ^~
drivers/net/ethernet/natsemi/sonic.c:335:32: error: expected declaration specifiers or '...' before '&' token
335 | spin_unlock_irqrestore(&lp->lock, flags);
| ^
drivers/net/ethernet/natsemi/sonic.c:335:43: error: unknown type name 'flags'
335 | spin_unlock_irqrestore(&lp->lock, flags);
| ^~~~~
drivers/net/ethernet/natsemi/sonic.c:337:9: error: expected identifier or '(' before 'return'
337 | return NETDEV_TX_OK;
| ^~~~~~
drivers/net/ethernet/natsemi/sonic.c:338:1: error: expected identifier or '(' before '}' token
338 | }
| ^
cc1: some warnings being treated as errors
vim +123 include/net/net_debug.h
5b87be9e4978fe Eric Dumazet 2022-05-09 95
5b87be9e4978fe Eric Dumazet 2022-05-09 96 #define netif_emerg(priv, type, dev, fmt, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 97 netif_level(emerg, priv, type, dev, fmt, ##args)
5b87be9e4978fe Eric Dumazet 2022-05-09 98 #define netif_alert(priv, type, dev, fmt, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 99 netif_level(alert, priv, type, dev, fmt, ##args)
5b87be9e4978fe Eric Dumazet 2022-05-09 100 #define netif_crit(priv, type, dev, fmt, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 101 netif_level(crit, priv, type, dev, fmt, ##args)
5b87be9e4978fe Eric Dumazet 2022-05-09 102 #define netif_err(priv, type, dev, fmt, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 103 netif_level(err, priv, type, dev, fmt, ##args)
5b87be9e4978fe Eric Dumazet 2022-05-09 104 #define netif_warn(priv, type, dev, fmt, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 105 netif_level(warn, priv, type, dev, fmt, ##args)
5b87be9e4978fe Eric Dumazet 2022-05-09 106 #define netif_notice(priv, type, dev, fmt, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 107 netif_level(notice, priv, type, dev, fmt, ##args)
5b87be9e4978fe Eric Dumazet 2022-05-09 108 #define netif_info(priv, type, dev, fmt, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 109 netif_level(info, priv, type, dev, fmt, ##args)
5b87be9e4978fe Eric Dumazet 2022-05-09 110
5b87be9e4978fe Eric Dumazet 2022-05-09 111 #if defined(CONFIG_DYNAMIC_DEBUG) || \
5b87be9e4978fe Eric Dumazet 2022-05-09 112 (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
5b87be9e4978fe Eric Dumazet 2022-05-09 113 #define netif_dbg(priv, type, netdev, format, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 114 do { \
5b87be9e4978fe Eric Dumazet 2022-05-09 115 if (netif_msg_##type(priv)) \
5b87be9e4978fe Eric Dumazet 2022-05-09 116 dynamic_netdev_dbg(netdev, format, ##args); \
5b87be9e4978fe Eric Dumazet 2022-05-09 117 } while (0)
5b87be9e4978fe Eric Dumazet 2022-05-09 118 #elif defined(DEBUG)
5b87be9e4978fe Eric Dumazet 2022-05-09 119 #define netif_dbg(priv, type, dev, format, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 120 netif_printk(priv, type, KERN_DEBUG, dev, format, ##args)
5b87be9e4978fe Eric Dumazet 2022-05-09 121 #else
5b87be9e4978fe Eric Dumazet 2022-05-09 122 #define netif_dbg(priv, type, dev, format, args...) \
5b87be9e4978fe Eric Dumazet 2022-05-09 @123 ({ \
5b87be9e4978fe Eric Dumazet 2022-05-09 124 if (0) \
5b87be9e4978fe Eric Dumazet 2022-05-09 125 netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
5b87be9e4978fe Eric Dumazet 2022-05-09 126 0; \
5b87be9e4978fe Eric Dumazet 2022-05-09 127 })
5b87be9e4978fe Eric Dumazet 2022-05-09 128 #endif
5b87be9e4978fe Eric Dumazet 2022-05-09 129
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (74772 bytes)
Powered by blists - more mailing lists