net: ethernet: ti: cpsw: drop CPSW_HEADROOM define
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 8 Apr 2022 13:48:38 +0000 (16:48 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Apr 2022 11:27:33 +0000 (12:27 +0100)
Since commit 1771afd47430 ("net: cpsw: avoid alignment faults by taking
NET_IP_ALIGN into account") the TI CPSW driver was switched to use correct
define CPSW_HEADROOM_NA to avoid alignment faults, but there are two places
left where CPSW_HEADROOM is still used (without causing issues).

Hence, completely drop CPSW_HEADROOM define and use CPSW_HEADROOM_NA
everywhere to avoid further mistakes in code.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/cpsw_new.c
drivers/net/ethernet/ti/cpsw_priv.h

index 03575c0175008af8e194f2e6084a41ff7446cb2b..e4edcc8c688985a2254fe9087940d2cb3c1abdb5 100644 (file)
@@ -335,7 +335,7 @@ static void cpsw_ndo_set_rx_mode(struct net_device *ndev)
 
 static unsigned int cpsw_rxbuf_total_len(unsigned int len)
 {
-       len += CPSW_HEADROOM;
+       len += CPSW_HEADROOM_NA;
        len += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
 
        return SKB_DATA_ALIGN(len);
index bd4b1528cf99258d52ea70864d89b411f79e4a36..394145d06d54f1fcca7d8ac44767e932a8e5bac0 100644 (file)
@@ -273,7 +273,7 @@ static void cpsw_ndo_set_rx_mode(struct net_device *ndev)
 
 static unsigned int cpsw_rxbuf_total_len(unsigned int len)
 {
-       len += CPSW_HEADROOM;
+       len += CPSW_HEADROOM_NA;
        len += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
 
        return SKB_DATA_ALIGN(len);
index 74555970730cd5969cfcec8723de8c52096998c2..86a0a1a093b5ab9eaf4dcf910b8ec76be92bfa81 100644 (file)
@@ -411,7 +411,6 @@ struct __aligned(sizeof(long)) cpsw_meta_xdp {
 
 /* The buf includes headroom compatible with both skb and xdpf */
 #define CPSW_HEADROOM_NA (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) + NET_IP_ALIGN)
-#define CPSW_HEADROOM  ALIGN(CPSW_HEADROOM_NA, sizeof(long))
 
 static inline int cpsw_is_xdpf_handle(void *handle)
 {