Nikolay Aleksandrov
2018-Nov-24 02:34 UTC
[Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts
Now that we have at least one bool option, we can export all of the supported bool options via optmask when dumping them. v2: new patch Signed-off-by: Nikolay Aleksandrov <nikolay at cumulusnetworks.com> --- net/bridge/br.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br.c b/net/bridge/br.c index b4a51a053586..4e7cd993ce94 100644 --- a/net/bridge/br.c +++ b/net/bridge/br.c @@ -247,7 +247,7 @@ void br_boolopt_multi_get(const struct net_bridge *br, optval |= (br_boolopt_get(br, opt_id) << opt_id); bm->optval = optval; - bm->optmask = 0; + bm->optmask = GENMASK((BR_BOOLOPT_MAX - 1), 0); } /* private bridge options, controlled by the kernel */ -- 2.17.2
Andrew Lunn
2018-Nov-24 16:16 UTC
[Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts
On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote:> Now that we have at least one bool option, we can export all of the > supported bool options via optmask when dumping them. >Hi Nik That answers my question then... I'm assuming this means there is no easy way to generate a bitmask of 0? So you waited until there was at least one bit. (1 << 2) - 1 = 3 (1 << 1) - 1 = 1 (1 << 0) - 1 = 0 So does GENMASK((BR_BOOLOPT_MAX - 1), 0); really not do the right thing when BR_BOOLOPT_MAX = 1? Andrew
Andrew Lunn
2018-Nov-24 16:26 UTC
[Bridge] [PATCH net-next v2 3/3] net: bridge: export supported boolopts
On Sat, Nov 24, 2018 at 04:34:22AM +0200, Nikolay Aleksandrov wrote:> Now that we have at least one bool option, we can export all of the > supported bool options via optmask when dumping them. > > v2: new patch > > Signed-off-by: Nikolay Aleksandrov <nikolay at cumulusnetworks.com>Reviewed-by: Andrew Lunn <andrew at lunn.ch> Andrew