Commit 203cb737 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'smsc-w-1-warning-fixes'

Andrew Lunn says:

====================
smsc W=1 warning fixes

Fixup various W=1 warnings, and then add COMPILE_TEST support, which
explains why these where missed on the previous pass.

v2:
Use while (0)
Rework buffer alignment to make it clearer

v3:
Access the length from the hardware and Use __always_unused to tell the
compiler we want to discard the value.
====================

Link: https://lore.kernel.org/r/20201110030248.1480413-1-andrew@lunn.chSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents cef21196 7958ba7e
...@@ -8,7 +8,7 @@ config NET_VENDOR_SMSC ...@@ -8,7 +8,7 @@ config NET_VENDOR_SMSC
default y default y
depends on ARM || ARM64 || ATARI_ETHERNAT || COLDFIRE || \ depends on ARM || ARM64 || ATARI_ETHERNAT || COLDFIRE || \
ISA || MAC || MIPS || NIOS2 || PCI || \ ISA || MAC || MIPS || NIOS2 || PCI || \
PCMCIA || SUPERH || XTENSA || H8300 PCMCIA || SUPERH || XTENSA || H8300 || COMPILE_TEST
help help
If you have a network (Ethernet) card belonging to this class, say Y. If you have a network (Ethernet) card belonging to this class, say Y.
...@@ -39,7 +39,7 @@ config SMC91X ...@@ -39,7 +39,7 @@ config SMC91X
select MII select MII
depends on !OF || GPIOLIB depends on !OF || GPIOLIB
depends on ARM || ARM64 || ATARI_ETHERNAT || COLDFIRE || \ depends on ARM || ARM64 || ATARI_ETHERNAT || COLDFIRE || \
MIPS || NIOS2 || SUPERH || XTENSA || H8300 MIPS || NIOS2 || SUPERH || XTENSA || H8300 || COMPILE_TEST
help help
This is a driver for SMC's 91x series of Ethernet chipsets, This is a driver for SMC's 91x series of Ethernet chipsets,
including the SMC91C94 and the SMC91C111. Say Y if you want it including the SMC91C94 and the SMC91C111. Say Y if you want it
...@@ -78,7 +78,7 @@ config SMC911X ...@@ -78,7 +78,7 @@ config SMC911X
tristate "SMSC LAN911[5678] support" tristate "SMSC LAN911[5678] support"
select CRC32 select CRC32
select MII select MII
depends on (ARM || SUPERH) depends on (ARM || SUPERH || COMPILE_TEST)
help help
This is a driver for SMSC's LAN911x series of Ethernet chipsets This is a driver for SMSC's LAN911x series of Ethernet chipsets
including the new LAN9115, LAN9116, LAN9117, and LAN9118. including the new LAN9115, LAN9116, LAN9117, and LAN9118.
......
...@@ -102,7 +102,10 @@ MODULE_ALIAS("platform:smc911x"); ...@@ -102,7 +102,10 @@ MODULE_ALIAS("platform:smc911x");
#define PRINTK(dev, args...) netdev_info(dev, args) #define PRINTK(dev, args...) netdev_info(dev, args)
#else #else
#define DBG(n, dev, args...) do { } while (0) #define DBG(n, dev, args...) \
while (0) { \
netdev_dbg(dev, args); \
}
#define PRINTK(dev, args...) netdev_dbg(dev, args) #define PRINTK(dev, args...) netdev_dbg(dev, args)
#endif #endif
...@@ -462,9 +465,9 @@ static void smc911x_hardware_send_pkt(struct net_device *dev) ...@@ -462,9 +465,9 @@ static void smc911x_hardware_send_pkt(struct net_device *dev)
TX_CMD_A_INT_FIRST_SEG_ | TX_CMD_A_INT_LAST_SEG_ | TX_CMD_A_INT_FIRST_SEG_ | TX_CMD_A_INT_LAST_SEG_ |
skb->len; skb->len;
#else #else
buf = (char*)((u32)skb->data & ~0x3); buf = (char *)((uintptr_t)skb->data & ~0x3);
len = (skb->len + 3 + ((u32)skb->data & 3)) & ~0x3; len = (skb->len + 3 + ((uintptr_t)skb->data & 3)) & ~0x3;
cmdA = (((u32)skb->data & 0x3) << 16) | cmdA = (((uintptr_t)skb->data & 0x3) << 16) |
TX_CMD_A_INT_FIRST_SEG_ | TX_CMD_A_INT_LAST_SEG_ | TX_CMD_A_INT_FIRST_SEG_ | TX_CMD_A_INT_LAST_SEG_ |
skb->len; skb->len;
#endif #endif
...@@ -879,7 +882,7 @@ static void smc911x_phy_configure(struct work_struct *work) ...@@ -879,7 +882,7 @@ static void smc911x_phy_configure(struct work_struct *work)
int phyaddr = lp->mii.phy_id; int phyaddr = lp->mii.phy_id;
int my_phy_caps; /* My PHY capabilities */ int my_phy_caps; /* My PHY capabilities */
int my_ad_caps; /* My Advertised capabilities */ int my_ad_caps; /* My Advertised capabilities */
int status; int status __always_unused;
unsigned long flags; unsigned long flags;
DBG(SMC_DEBUG_FUNC, dev, "--> %s()\n", __func__); DBG(SMC_DEBUG_FUNC, dev, "--> %s()\n", __func__);
...@@ -973,7 +976,7 @@ static void smc911x_phy_interrupt(struct net_device *dev) ...@@ -973,7 +976,7 @@ static void smc911x_phy_interrupt(struct net_device *dev)
{ {
struct smc911x_local *lp = netdev_priv(dev); struct smc911x_local *lp = netdev_priv(dev);
int phyaddr = lp->mii.phy_id; int phyaddr = lp->mii.phy_id;
int status; int status __always_unused;
DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__); DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__);
...@@ -2044,8 +2047,6 @@ static int smc911x_drv_probe(struct platform_device *pdev) ...@@ -2044,8 +2047,6 @@ static int smc911x_drv_probe(struct platform_device *pdev)
void __iomem *addr; void __iomem *addr;
int ret; int ret;
/* ndev is not valid yet, so avoid passing it in. */
DBG(SMC_DEBUG_FUNC, "--> %s\n", __func__);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) { if (!res) {
ret = -ENODEV; ret = -ENODEV;
......
...@@ -703,7 +703,8 @@ static void smc_tx(struct net_device *dev) ...@@ -703,7 +703,8 @@ static void smc_tx(struct net_device *dev)
{ {
struct smc_local *lp = netdev_priv(dev); struct smc_local *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base; void __iomem *ioaddr = lp->base;
unsigned int saved_packet, packet_no, tx_status, pkt_len; unsigned int saved_packet, packet_no, tx_status;
unsigned int pkt_len __always_unused;
DBG(3, dev, "%s\n", __func__); DBG(3, dev, "%s\n", __func__);
...@@ -2191,6 +2192,12 @@ MODULE_DEVICE_TABLE(of, smc91x_match); ...@@ -2191,6 +2192,12 @@ MODULE_DEVICE_TABLE(of, smc91x_match);
/** /**
* of_try_set_control_gpio - configure a gpio if it exists * of_try_set_control_gpio - configure a gpio if it exists
* @dev: net device
* @desc: where to store the GPIO descriptor, if it exists
* @name: name of the GPIO in DT
* @index: index of the GPIO in DT
* @value: set the GPIO to this value
* @nsdelay: delay before setting the GPIO
*/ */
static int try_toggle_control_gpio(struct device *dev, static int try_toggle_control_gpio(struct device *dev,
struct gpio_desc **desc, struct gpio_desc **desc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment