Re: [PATCH net-next 04/15] ethtool: add ethnl_parse_bitset() helper
From: Michal Kubecek
Date: Thu Mar 12 2020 - 05:25:38 EST
On Wed, Mar 11, 2020 at 10:48:21PM -0700, David Miller wrote:
> From: Michal Kubecek <mkubecek@xxxxxxx>
> Date: Wed, 11 Mar 2020 22:40:23 +0100 (CET)
>
> > +int ethnl_parse_bitset(unsigned long *val, unsigned long *mask,
> > + unsigned int nbits, const struct nlattr *attr,
> > + ethnl_string_array_t names,
> > + struct netlink_ext_ack *extack)
> > +{
> ...
> > + if (bit_val)
> > + set_bit(idx, val);
> > + if (!no_mask)
> > + set_bit(idx, mask);
>
> You can certainly use non-atomic __set_bit() in this context.
Right, thanks.
Michal