lkml.org 
[lkml]   [2020]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v2] net: dsa: qca8k: Add 802.1q VLAN support
On Thu, Jul 30, 2020 at 11:40:29AM +0100, Jonathan McDowell wrote:
> > > +
> > > + for (vid = vlan->vid_begin; vid <= vlan->vid_end && !ret; ++vid)
> > > + ret = qca8k_vlan_add(priv, port, vid, !untagged);
> > > +
> > > + if (ret)
> > > + dev_err(priv->dev, "Failed to add VLAN to port %d (%d)", port, ret);
> > > +
> >
> > If for some reason there is a temporary failure in qca8k_vlan_add, you'd
> > be swallowing it instead of printing the error and stopping the
> > execution.
>
> I don't follow; I'm breaking out of the for loop when we get an error? I
> figured that was a better move than potentially printing 4095 error
> messages if they were all going to fail.
>

Oh, you are. What an exotic way to write this loop, my brain stopped
parsing beyond "vid_end".

Thanks,
-Vladimir

\
 
 \ /
  Last update: 2020-07-30 23:11    [W:0.055 / U:1.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site