Re: [PATCH v2] myri10ge: remove an unneeded NULL check

From: Paolo Abeni
Date: Tue Mar 22 2022 - 05:33:06 EST


Hello,

On Sun, 2022-03-20 at 12:44 +0800, Xiaomeng Tong wrote:
> The define of skb_list_walk_safe(first, skb, next_skb) is:
> for ((skb) = (first), (next_skb) = (skb) ? (skb)->next : NULL; (skb); \
> (skb) = (next_skb), (next_skb) = (skb) ? (skb)->next : NULL)
>
> Thus, if the 'segs' passed as 'first' into the skb_list_walk_safe is NULL,
> the loop will exit immediately. In other words, it can be sure the 'segs'
> is non-NULL when we run inside the loop. So just remove the unnecessary
> NULL check. Also remove the unneeded assignmnets.
>
> Signed-off-by: Xiaomeng Tong <xiam0nd.tong@xxxxxxxxx>

This is pure net-next material, and we are now into the merge window -
only fixes allowed. Please repost in 2w, thanks!

Paolo