[PATCH net-next v2 2/7] net: ethernet: fs_enet: cosmetic cleanups

Andrew Lunn andrew at lunn.ch
Sat Aug 31 07:00:12 AEST 2024


> @@ -235,15 +219,15 @@ static int fs_enet_napi(struct napi_struct *napi, int budget)
>  			if (pkt_len <= fpi->rx_copybreak) {
>  				/* +2 to make IP header L1 cache aligned */
>  				skbn = netdev_alloc_skb(dev, pkt_len + 2);
> -				if (skbn != NULL) {
> +				if (skbn) {
>  					skb_reserve(skbn, 2);	/* align IP header */
> -					skb_copy_from_linear_data(skb,
> -						      skbn->data, pkt_len);
> +					skb_copy_from_linear_data(skb, skbn->data,
> +								  pkt_len);
>  					swap(skb, skbn);
>  					dma_sync_single_for_cpu(fep->dev,
> -						CBDR_BUFADDR(bdp),
> -						L1_CACHE_ALIGN(pkt_len),
> -						DMA_FROM_DEVICE);
> +								CBDR_BUFADDR(bdp),
> +								L1_CACHE_ALIGN(pkt_len),
> +								DMA_FROM_DEVICE);

The indentation level here suggest refactoring into helpers might be
nice. But not a prerequisite for merging.

Reviewed-by: Andrew Lunn <andrew at lunn.ch>

    Andrew


More information about the Linuxppc-dev mailing list