Skip to content

Commit f96f700

Browse files
Marek Vasutkuba-moo
authored andcommitted
net: ks8851: Inline ks8851_rx_skb()
Both ks8851_rx_skb_par() and ks8851_rx_skb_spi() call netif_rx(skb), inline the netif_rx(skb) call directly into ks8851_common.c and drop the .rx_skb callback and ks8851_rx_skb() wrapper. This removes one indirect call from the driver, no functional change otherwise. Signed-off-by: Marek Vasut <marex@denx.de> Link: https://lore.kernel.org/r/20240405203204.82062-1-marex@denx.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 7e68708 commit f96f700

File tree

4 files changed

+1
-36
lines changed

4 files changed

+1
-36
lines changed

drivers/net/ethernet/micrel/ks8851.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ union ks8851_tx_hdr {
368368
* @rdfifo: FIFO read callback
369369
* @wrfifo: FIFO write callback
370370
* @start_xmit: start_xmit() implementation callback
371-
* @rx_skb: rx_skb() implementation callback
372371
* @flush_tx_work: flush_tx_work() implementation callback
373372
*
374373
* The @statelock is used to protect information in the structure which may
@@ -423,8 +422,6 @@ struct ks8851_net {
423422
struct sk_buff *txp, bool irq);
424423
netdev_tx_t (*start_xmit)(struct sk_buff *skb,
425424
struct net_device *dev);
426-
void (*rx_skb)(struct ks8851_net *ks,
427-
struct sk_buff *skb);
428425
void (*flush_tx_work)(struct ks8851_net *ks);
429426
};
430427

drivers/net/ethernet/micrel/ks8851_common.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,6 @@ static void ks8851_dbg_dumpkkt(struct ks8851_net *ks, u8 *rxpkt)
231231
rxpkt[12], rxpkt[13], rxpkt[14], rxpkt[15]);
232232
}
233233

234-
/**
235-
* ks8851_rx_skb - receive skbuff
236-
* @ks: The device state.
237-
* @skb: The skbuff
238-
*/
239-
static void ks8851_rx_skb(struct ks8851_net *ks, struct sk_buff *skb)
240-
{
241-
ks->rx_skb(ks, skb);
242-
}
243-
244234
/**
245235
* ks8851_rx_pkts - receive packets from the host
246236
* @ks: The device information.
@@ -309,7 +299,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
309299
ks8851_dbg_dumpkkt(ks, rxpkt);
310300

311301
skb->protocol = eth_type_trans(skb, ks->netdev);
312-
ks8851_rx_skb(ks, skb);
302+
netif_rx(skb);
313303

314304
ks->netdev->stats.rx_packets++;
315305
ks->netdev->stats.rx_bytes += rxlen;

drivers/net/ethernet/micrel/ks8851_par.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,6 @@ static void ks8851_wrfifo_par(struct ks8851_net *ks, struct sk_buff *txp,
210210
iowrite16_rep(ksp->hw_addr, txp->data, len / 2);
211211
}
212212

213-
/**
214-
* ks8851_rx_skb_par - receive skbuff
215-
* @ks: The device state.
216-
* @skb: The skbuff
217-
*/
218-
static void ks8851_rx_skb_par(struct ks8851_net *ks, struct sk_buff *skb)
219-
{
220-
netif_rx(skb);
221-
}
222-
223213
static unsigned int ks8851_rdreg16_par_txqcr(struct ks8851_net *ks)
224214
{
225215
return ks8851_rdreg16_par(ks, KS_TXQCR);
@@ -298,7 +288,6 @@ static int ks8851_probe_par(struct platform_device *pdev)
298288
ks->rdfifo = ks8851_rdfifo_par;
299289
ks->wrfifo = ks8851_wrfifo_par;
300290
ks->start_xmit = ks8851_start_xmit_par;
301-
ks->rx_skb = ks8851_rx_skb_par;
302291

303292
#define STD_IRQ (IRQ_LCI | /* Link Change */ \
304293
IRQ_RXI | /* RX done */ \

drivers/net/ethernet/micrel/ks8851_spi.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,6 @@ static unsigned int calc_txlen(unsigned int len)
298298
return ALIGN(len + 4, 4);
299299
}
300300

301-
/**
302-
* ks8851_rx_skb_spi - receive skbuff
303-
* @ks: The device state
304-
* @skb: The skbuff
305-
*/
306-
static void ks8851_rx_skb_spi(struct ks8851_net *ks, struct sk_buff *skb)
307-
{
308-
netif_rx(skb);
309-
}
310-
311301
/**
312302
* ks8851_tx_work - process tx packet(s)
313303
* @work: The work strucutre what was scheduled.
@@ -435,7 +425,6 @@ static int ks8851_probe_spi(struct spi_device *spi)
435425
ks->rdfifo = ks8851_rdfifo_spi;
436426
ks->wrfifo = ks8851_wrfifo_spi;
437427
ks->start_xmit = ks8851_start_xmit_spi;
438-
ks->rx_skb = ks8851_rx_skb_spi;
439428
ks->flush_tx_work = ks8851_flush_tx_work_spi;
440429

441430
#define STD_IRQ (IRQ_LCI | /* Link Change */ \

0 commit comments

Comments
 (0)