Luca Coelho <[email protected]> writes:

> From: Sara Sharon <[email protected]>
>
> Support getting mac80211 building AMSDUs for us. Remove GSO
> support from mvm - we don't need it anymore.
>
> Signed-off-by: Sara Sharon <[email protected]>
> Signed-off-by: Luca Coelho <[email protected]>

[...]

> +static bool iwl_mvm_can_hw_csum(struct sk_buff *skb)
> +{
> +#if IS_ENABLED(CONFIG_INET)
> +     u8 protocol = ip_hdr(skb)->protocol;
> +
> +     return protocol == IPPROTO_TCP || protocol == IPPROTO_UDP;
> +#else
> +     return false;
> +#endif
> +}

I remember Andrew Morton a long time ago saying "Write in C, not in CPP"
or something like that. So would this work instead:

        u8 protocol = ip_hdr(skb)->protocol;

        if (!IS_ENABLED(CONFIG_INET))
                return false;

        return protocol == IPPROTO_TCP || protocol == IPPROTO_UDP;

Totally untested, of course :)

-- 
Kalle Valo

Reply via email to