Subject: Re: [PATCH net 3/5] macsec: fix secy->n_rx_sc accounting

From: Sabrina Dubroca <[email-masked]>
Date: Fri, 14 Oct 2022 09:43:41 +0200

2022-10-14, 09:16:56 +0300, Leon Romanovsky wrote:
[...]
> > @@ -1897,15 +1899,16 @@ static int macsec_add_rxsc(struct sk_buff *skb, struct genl_info *info)
> >  	secy = &macsec_priv(dev)->secy;
> >  	sci = nla_get_sci(tb_rxsc[MACSEC_RXSC_ATTR_SCI]);
> >  
> > -	rx_sc = create_rx_sc(dev, sci);
> > +
> > +	if (tb_rxsc[MACSEC_RXSC_ATTR_ACTIVE])
> > +		active = !!nla_get_u8(tb_rxsc[MACSEC_RXSC_ATTR_ACTIVE]);
> 
> You don't need !! to assign to bool variables and can safely omit them.

Yeah, but I'm just moving existing code, see below.

(please trim your replies, nobody wants to scroll through endless
quoting just to find one comment hiding in the middle)

> 
> thanks
> 
> > +
> > +	rx_sc = create_rx_sc(dev, sci, active);
> >  	if (IS_ERR(rx_sc)) {
> >  		rtnl_unlock();
> >  		return PTR_ERR(rx_sc);
> >  	}
> >  
> > -	if (tb_rxsc[MACSEC_RXSC_ATTR_ACTIVE])
> > -		rx_sc->active = !!nla_get_u8(tb_rxsc[MACSEC_RXSC_ATTR_ACTIVE]);

-- 
Sabrina