>From 5d6d0fc40c5e37bf1bea95bf11c598c61c2a9bc2 Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Sun, 5 Apr 2020 13:08:50 +0200 Subject: [PATCH 1/2] net: ks8851: Unbreak the build of CONFIG_KS8851 drivers/net/ethernet/micrel/ks8851_spi.c: In function 'ks8851_start_xmit': drivers/net/ethernet/micrel/ks8851_spi.c:360:20: error: implicit declaration of function 'calc_txlen' [-Werror=implicit-function-declaration] unsigned needed = calc_txlen(skb->len); ^~~~~~~~~~ drivers/net/ethernet/micrel/ks8851_spi.c:377:19: error: 'struct ks8851_net' has no member named 'tx_work' schedule_work(&ks->tx_work); ^~ Signed-off-by: Lukas Wunner --- drivers/net/ethernet/micrel/ks8851_common.c | 12 ------------ drivers/net/ethernet/micrel/ks8851_spi.c | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/micrel/ks8851_common.c b/drivers/net/ethernet/micrel/ks8851_common.c index b708c01f9f33..9878369efda2 100644 --- a/drivers/net/ethernet/micrel/ks8851_common.c +++ b/drivers/net/ethernet/micrel/ks8851_common.c @@ -363,18 +363,6 @@ static irqreturn_t ks8851_irq(int irq, void *_ks) return IRQ_HANDLED; } -/** - * calc_txlen - calculate size of message to send packet - * @len: Length of data - * - * Returns the size of the TXFIFO message needed to send - * this packet. - */ -static inline unsigned calc_txlen(unsigned len) -{ - return ALIGN(len + 4, 4); -} - /** * ks8851_net_open - open network device * @dev: The network device being opened. diff --git a/drivers/net/ethernet/micrel/ks8851_spi.c b/drivers/net/ethernet/micrel/ks8851_spi.c index e245ad0b82f4..d08a51c55236 100644 --- a/drivers/net/ethernet/micrel/ks8851_spi.c +++ b/drivers/net/ethernet/micrel/ks8851_spi.c @@ -236,6 +236,18 @@ void ks8851_rdfifo(struct ks8851_net *ks, u8 *buff, unsigned int len) netdev_err(ks->netdev, "%s: spi_sync() failed\n", __func__); } +/** + * calc_txlen - calculate size of message to send packet + * @len: Length of data + * + * Returns the size of the TXFIFO message needed to send + * this packet. + */ +static inline unsigned calc_txlen(unsigned len) +{ + return ALIGN(len + 4, 4); +} + /** * ks8851_wrfifo - write packet to TX FIFO via SPI * @ks: The device state. @@ -357,6 +369,7 @@ void ks8851_flush_tx_work(struct ks8851_net *ks) netdev_tx_t ks8851_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ks8851_net *ks = netdev_priv(dev); + struct ks8851_net_spi *kss = to_ks8851_spi(ks); unsigned needed = calc_txlen(skb->len); netdev_tx_t ret = NETDEV_TX_OK; @@ -374,7 +387,7 @@ netdev_tx_t ks8851_start_xmit(struct sk_buff *skb, struct net_device *dev) } spin_unlock(&ks->statelock); - schedule_work(&ks->tx_work); + schedule_work(&kss->tx_work); return ret; } -- 2.25.0