Re: [RFC PATCH 11/16] net: dsa: Refactor selection of tag ops into a function

2016-05-27 Thread Andrew Lunn
On Fri, May 27, 2016 at 03:35:57PM -0400, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > > > @@ -26,6 +26,7 @@ enum dsa_tag_protocol { > > DSA_TAG_PROTO_TRAILER, > > DSA_TAG_PROTO_EDSA, > > DSA_TAG_PROTO_BRCM, > > + _DSA_TAG_LAST, > > }; > > I would

Re: [RFC PATCH 11/16] net: dsa: Refactor selection of tag ops into a function

2016-05-27 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > @@ -26,6 +26,7 @@ enum dsa_tag_protocol { > DSA_TAG_PROTO_TRAILER, > DSA_TAG_PROTO_EDSA, > DSA_TAG_PROTO_BRCM, > + _DSA_TAG_LAST, > }; I would avoid _ prefixed functions or symbols, we've seen in mv88e6xxx that it doesn't

[RFC PATCH 11/16] net: dsa: Refactor selection of tag ops into a function

2016-05-26 Thread Andrew Lunn
Replace the two switch statements with an array lookup, and store the result in the dsa tree structure. The drivers no longer need to know the selected tag protocol, so remove it from the dsa switch structure. Signed-off-by: Andrew Lunn --- include/net/dsa.h | 8 +-