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

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>

authored by

Marek Vasut and committed by
Jakub Kicinski
f96f7004 7e68708b

+1 -36
-3
drivers/net/ethernet/micrel/ks8851.h
··· 368 368 * @rdfifo: FIFO read callback 369 369 * @wrfifo: FIFO write callback 370 370 * @start_xmit: start_xmit() implementation callback 371 - * @rx_skb: rx_skb() implementation callback 372 371 * @flush_tx_work: flush_tx_work() implementation callback 373 372 * 374 373 * The @statelock is used to protect information in the structure which may ··· 422 423 struct sk_buff *txp, bool irq); 423 424 netdev_tx_t (*start_xmit)(struct sk_buff *skb, 424 425 struct net_device *dev); 425 - void (*rx_skb)(struct ks8851_net *ks, 426 - struct sk_buff *skb); 427 426 void (*flush_tx_work)(struct ks8851_net *ks); 428 427 }; 429 428
+1 -11
drivers/net/ethernet/micrel/ks8851_common.c
··· 232 232 } 233 233 234 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 - 244 - /** 245 235 * ks8851_rx_pkts - receive packets from the host 246 236 * @ks: The device information. 247 237 * ··· 299 309 ks8851_dbg_dumpkkt(ks, rxpkt); 300 310 301 311 skb->protocol = eth_type_trans(skb, ks->netdev); 302 - ks8851_rx_skb(ks, skb); 312 + netif_rx(skb); 303 313 304 314 ks->netdev->stats.rx_packets++; 305 315 ks->netdev->stats.rx_bytes += rxlen;
-11
drivers/net/ethernet/micrel/ks8851_par.c
··· 210 210 iowrite16_rep(ksp->hw_addr, txp->data, len / 2); 211 211 } 212 212 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 - 223 213 static unsigned int ks8851_rdreg16_par_txqcr(struct ks8851_net *ks) 224 214 { 225 215 return ks8851_rdreg16_par(ks, KS_TXQCR); ··· 288 298 ks->rdfifo = ks8851_rdfifo_par; 289 299 ks->wrfifo = ks8851_wrfifo_par; 290 300 ks->start_xmit = ks8851_start_xmit_par; 291 - ks->rx_skb = ks8851_rx_skb_par; 292 301 293 302 #define STD_IRQ (IRQ_LCI | /* Link Change */ \ 294 303 IRQ_RXI | /* RX done */ \
-11
drivers/net/ethernet/micrel/ks8851_spi.c
··· 299 299 } 300 300 301 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 - 311 - /** 312 302 * ks8851_tx_work - process tx packet(s) 313 303 * @work: The work strucutre what was scheduled. 314 304 * ··· 425 435 ks->rdfifo = ks8851_rdfifo_spi; 426 436 ks->wrfifo = ks8851_wrfifo_spi; 427 437 ks->start_xmit = ks8851_start_xmit_spi; 428 - ks->rx_skb = ks8851_rx_skb_spi; 429 438 ks->flush_tx_work = ks8851_flush_tx_work_spi; 430 439 431 440 #define STD_IRQ (IRQ_LCI | /* Link Change */ \