> > +static u32 virtnet_get_priv_flags(struct net_device *dev)
> > +{
> > +     struct virtnet_info *vi = netdev_priv(dev);
> > +     int priv_flags = 0;
> > +
> > +     if (vi->sq[0].napi.weight)
> > +             priv_flags |= 0x1;
> > +
> > +     return priv_flags;
> > +}
>
> Why the use of priv_flags here?  Is there some reason that we don't want
> to use the more simple
>
>     static u32 virtnet_get_priv_flags(struct net_device *dev)
>     {
>             struct virtnet_info *vi = netdev_priv(dev);
>
>             if (vi->sq[0].napi.weight)
>                     return 1;
>
>             return 0;
>     }

Sure, that's fine, too.

I just wanted to make it explicit that this is one of possibly many
private flags,
and only acts on bit 0. If another private flag is added, the existing
code needs
little change, just add a branch on another bit. But either way works.

Reply via email to