@@ -703,7 +703,7 @@ static void smc_tx(struct net_device *dev)
{
struct smc_local *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base;
- unsigned int saved_packet, packet_no, tx_status, pkt_len;
+ unsigned int saved_packet, packet_no, tx_status;
DBG(3, dev, "%s\n", __func__);
@@ -720,7 +720,7 @@ static void smc_tx(struct net_device *dev)
/* read the first word (status word) from this packet */
SMC_SET_PTR(lp, PTR_AUTOINC | PTR_READ);
- SMC_GET_PKT_HDR(lp, tx_status, pkt_len);
+ SMC_GET_PKT_HDR_STATUS(lp, tx_status);
DBG(2, dev, "TX STATUS 0x%04x PNR 0x%02x\n",
tx_status, packet_no);
@@ -1056,6 +1056,16 @@ static const char * chip_ids[ 16 ] = {
} \
} while (0)
+#define SMC_GET_PKT_HDR_STATUS(lp, status) \
+ do { \
+ if (SMC_32BIT(lp)) { \
+ unsigned int __val = SMC_inl(ioaddr, DATA_REG(lp)); \
+ (status) = __val & 0xffff; \
+ } else { \
+ (status) = SMC_inw(ioaddr, DATA_REG(lp)); \
+ } \
+ } while (0)
+
#define SMC_PUSH_DATA(lp, p, l) \
do { \
if (SMC_32BIT(lp)) { \
drivers/net/ethernet/smsc/smc91x.c:706:51: warning: variable ‘pkt_len’ set but not used [-Wunused-but-set-variable] 706 | unsigned int saved_packet, packet_no, tx_status, pkt_len; Add a new macro for getting fields out of the header, which only gets the status, not the length which in this case is not needed. Signed-off-by: Andrew Lunn <andrew@lunn.ch> --- drivers/net/ethernet/smsc/smc91x.c | 4 ++-- drivers/net/ethernet/smsc/smc91x.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-)