RE: [Intel-wired-lan] [PATCH v2 net-next 2/4] ice: switch: unobscurify bitops loop in ice_fill_adv_dummy_packet()

From: Penigalapati, Sandeep
Date: Fri Feb 18 2022 - 00:22:19 EST


>-----Original Message-----
>From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
>Alexander Lobakin
>Sent: Thursday, January 27, 2022 9:10 PM
>To: intel-wired-lan@xxxxxxxxxxxxxxxx
>Cc: Szapar-Mudlaw, Martyna <martyna.szapar-mudlaw@xxxxxxxxx>;
>netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Jakub Kicinski
><kuba@xxxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>
>Subject: [Intel-wired-lan] [PATCH v2 net-next 2/4] ice: switch: unobscurify
>bitops loop in ice_fill_adv_dummy_packet()
>
>A loop performing header modification according to the provided mask in
>ice_fill_adv_dummy_packet() is very cryptic (and error-prone).
>Replace two identical cast-deferences with a variable. Replace three struct-
>member-array-accesses with a variable. Invert the condition, reduce the
>indentation by one -> eliminate line wraps.
>
>Signed-off-by: Alexander Lobakin <alexandr.lobakin@xxxxxxxxx>
>---
> drivers/net/ethernet/intel/ice/ice_switch.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@xxxxxxxxx>