On Thu, Dec 3, 2020 at 11:45 AM Jakub Kicinski <k...@kernel.org> wrote:
...
> nit: let's narrow down the ifdef-enery
>
> no need for the ifdef here, if the helper looks like this:
>
> +static void bond_set_xfrm_features(struct net_device *bond_dev, u64 mode)
> +{
> +#ifdef CONFIG_XFRM_OFFLOAD
> +       if (mode == BOND_MODE_ACTIVEBACKUP)
> +               bond_dev->wanted_features |= BOND_XFRM_FEATURES;
> +       else
> +               bond_dev->wanted_features &= ~BOND_XFRM_FEATURES;
> +
> +       netdev_update_features(bond_dev);
> +#endif /* CONFIG_XFRM_OFFLOAD */
> +}
>
> Even better:
>
> +static void bond_set_xfrm_features(struct net_device *bond_dev, u64 mode)
> +{
> +       if (!IS_ENABLED(CONFIG_XFRM_OFFLOAD))
> +               return;
> +
> +       if (mode == BOND_MODE_ACTIVEBACKUP)
> +               bond_dev->wanted_features |= BOND_XFRM_FEATURES;
> +       else
> +               bond_dev->wanted_features &= ~BOND_XFRM_FEATURES;
> +
> +       netdev_update_features(bond_dev);
> +}
>
> (Assuming BOND_XFRM_FEATURES doesn't itself hide under an ifdef.)

It is, but doesn't need to be. I can mix these changes in as well.

-- 
Jarod Wilson
ja...@redhat.com

Reply via email to