2022-05-11 09:11:01

by z

[permalink] [raw]
Subject: [PATCH] intel/i40e: delete if NULL check before dev_kfree_skb

dev_kfree_skb check if the input parameter NULL and do the right
thing, there is no need to check again.
This change is to cleanup the code a bit.

Signed-off-by: Bernard Zhao <[email protected]>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 0eae5858f2fe..98cfadfd0f35 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1482,10 +1482,8 @@ void i40e_clean_rx_ring(struct i40e_ring *rx_ring)
if (!rx_ring->rx_bi)
return;

- if (rx_ring->skb) {
- dev_kfree_skb(rx_ring->skb);
- rx_ring->skb = NULL;
- }
+ dev_kfree_skb(rx_ring->skb);
+ rx_ring->skb = NULL;

if (rx_ring->xsk_pool) {
i40e_xsk_clean_rx_ring(rx_ring);
--
2.33.1



2022-05-17 22:23:33

by G, GurucharanX

[permalink] [raw]
Subject: RE: [Intel-wired-lan] [PATCH] intel/i40e: delete if NULL check before dev_kfree_skb



> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of
> Bernard Zhao
> Sent: Wednesday, May 11, 2022 12:25 PM
> To: Brandeburg, Jesse <[email protected]>; Nguyen, Anthony L
> <[email protected]>; David S. Miller <[email protected]>;
> Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>;
> [email protected]; [email protected]; linux-
> [email protected]
> Cc: [email protected]; Bernard Zhao <[email protected]>
> Subject: [Intel-wired-lan] [PATCH] intel/i40e: delete if NULL check before
> dev_kfree_skb
>
> dev_kfree_skb check if the input parameter NULL and do the right
> thing, there is no need to check again.
> This change is to cleanup the code a bit.
>
> Signed-off-by: Bernard Zhao <[email protected]>
> ---
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>

Tested-by: Gurucharan <[email protected]> (A Contingent worker at Intel)

2022-05-25 08:24:12

by G, GurucharanX

[permalink] [raw]
Subject: RE: [Intel-wired-lan] [PATCH] intel/i40e: delete if NULL check before dev_kfree_skb



> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of
> Bernard Zhao
> Sent: Wednesday, May 11, 2022 12:25 PM
> To: Brandeburg, Jesse <[email protected]>; Nguyen, Anthony L
> <[email protected]>; David S. Miller <[email protected]>;
> Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>;
> [email protected]; [email protected]; linux-
> [email protected]
> Cc: [email protected]; Bernard Zhao <[email protected]>
> Subject: [Intel-wired-lan] [PATCH] intel/i40e: delete if NULL check before
> dev_kfree_skb
>
> dev_kfree_skb check if the input parameter NULL and do the right thing,
> there is no need to check again.
> This change is to cleanup the code a bit.
>
> Signed-off-by: Bernard Zhao <[email protected]>
> ---
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>

Tested-by: Gurucharan <[email protected]> (A Contingent worker at Intel)