[PATCH net-next 3/6] net: dcb: add new rewrite table

Daniel.Machon at microchip.com Daniel.Machon at microchip.com
Mon Jan 16 04:52:36 PST 2023


Hi Dan,
Thank you for your feedback.

> On Thu, Jan 12, 2023 at 09:15:51PM +0100, Daniel Machon wrote:
> > +/* Get protocol value from rewrite entry. */
> > +u16 dcb_getrewr(struct net_device *dev, struct dcb_app *app)
>    ^^^
> 
> > +{
> > +     struct dcb_app_type *itr;
> > +     u8 proto = 0;
> 
> Should "proto" be a u16 to match itr->app.protocol and the return type?

It should.

> 
> > +
> > +     spin_lock_bh(&dcb_lock);
> > +     itr = dcb_rewr_lookup(app, dev->ifindex, -1);
> > +     if (itr)
> > +             proto = itr->app.protocol;
> > +     spin_unlock_bh(&dcb_lock);
> > +
> > +     return proto;
> > +}
> > +EXPORT_SYMBOL(dcb_getrewr);
> > +
> > + /* Add rewrite entry to the rewrite list. */
> > +int dcb_setrewr(struct net_device *dev, struct dcb_app *new)
> > +{
> > +     int err = 0;
> 
> No need to initialize this.  It only disables static checkers and
> triggers a false positive about dead stores.

Yes, you are right :)

Will be fixed in next version.

/Daniel


More information about the linux-arm-kernel mailing list