Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: tulip: avoid unused variable warning

There is an effort to achieve W=1 kernel builds without warnings.
As part of that effort Helge Deller highlighted the following warnings
in the tulip driver when compiling with W=1 and CONFIG_TULIP_MWI=n:

.../tulip_core.c: In function ‘tulip_init_one’:
.../tulip_core.c:1309:22: warning: variable ‘force_csr0’ set but not used

This patch addresses that problem using IS_ENABLED(). This approach has
the added benefit of reducing conditionally compiled code. And thus
increasing compile coverage. E.g. for allmodconfig builds which enable
CONFIG_TULIP_MWI.

Compile tested only.
No run-time effect intended.

Acked-by: Helge Deller <deller@gmx.de>
Signed-off-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250318-tulip-w1-v3-1-a813fadd164d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Simon Horman and committed by
Jakub Kicinski
6165feda 5555b34c

+2 -5
+2 -5
drivers/net/ethernet/dec/tulip/tulip_core.c
··· 1177 1177 iowrite32(csr6, ioaddr + CSR6); 1178 1178 } 1179 1179 1180 - #ifdef CONFIG_TULIP_MWI 1181 1180 static void tulip_mwi_config(struct pci_dev *pdev, struct net_device *dev) 1182 1181 { 1183 1182 struct tulip_private *tp = netdev_priv(dev); ··· 1250 1251 netdev_dbg(dev, "MWI config cacheline=%d, csr0=%08x\n", 1251 1252 cache, csr0); 1252 1253 } 1253 - #endif 1254 1254 1255 1255 /* 1256 1256 * Chips that have the MRM/reserved bit quirk and the burst quirk. That ··· 1461 1463 1462 1464 INIT_WORK(&tp->media_work, tulip_tbl[tp->chip_id].media_task); 1463 1465 1464 - #ifdef CONFIG_TULIP_MWI 1465 - if (!force_csr0 && (tp->flags & HAS_PCI_MWI)) 1466 + if (IS_ENABLED(CONFIG_TULIP_MWI) && !force_csr0 && 1467 + (tp->flags & HAS_PCI_MWI)) 1466 1468 tulip_mwi_config (pdev, dev); 1467 - #endif 1468 1469 1469 1470 /* Stop the chip's Tx and Rx processes. */ 1470 1471 tulip_stop_rxtx(tp);