[PATCH net-next 4/8] net: microchip: sparx5: Add TC support for IS0 VCAP

Steen Hegelund steen.hegelund at microchip.com
Fri Jan 20 01:36:48 PST 2023


Hi Dan,

On Fri, 2023-01-20 at 12:13 +0300, Dan Carpenter wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> On Fri, Jan 20, 2023 at 10:08:27AM +0100, Steen Hegelund wrote:
> > -/* Add a rule counter action - only IS2 is considered for now */
> > +/* Add a rule counter action */
> >  static int sparx5_tc_add_rule_counter(struct vcap_admin *admin,
> >                                     struct vcap_rule *vrule)
> >  {
> > -     int err;
> > +     int err = 0;
> 
> Don't initialize.

Yep. No need for that.

> 
> > 
> > -     err = vcap_rule_mod_action_u32(vrule, VCAP_AF_CNT_ID, vrule->id);
> > -     if (err)
> > -             return err;
> > +     if (admin->vtype == VCAP_TYPE_IS2) {
> > +             err = vcap_rule_mod_action_u32(vrule, VCAP_AF_CNT_ID,
> > +                                            vrule->id);
> > +             if (err)
> > +                     return err;
> > +             vcap_rule_set_counter_id(vrule, vrule->id);
> > +     }
> > 
> > -     vcap_rule_set_counter_id(vrule, vrule->id);
> >       return err;
> 
> return 0;

I will update that.
> 
> >  }
> 
> regards,
> dan carpenter

Thanks for the review.

BR
Steen


More information about the linux-arm-kernel mailing list