From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751083AbdE3Ur6 (ORCPT ); Tue, 30 May 2017 16:47:58 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:33160 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750821AbdE3Ur4 (ORCPT ); Tue, 30 May 2017 16:47:56 -0400 Subject: Re: [PATCH net-next v2 3/6] net: dsa: remove dsa_uses_tagged_protocol To: Vivien Didelot , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn References: <20170530183319.10718-1-vivien.didelot@savoirfairelinux.com> <20170530183319.10718-4-vivien.didelot@savoirfairelinux.com> From: Florian Fainelli Message-ID: <3741e6b9-98a5-c587-ef8f-851b17cb3145@gmail.com> Date: Tue, 30 May 2017 13:47:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170530183319.10718-4-vivien.didelot@savoirfairelinux.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/30/2017 11:33 AM, Vivien Didelot wrote: > Since dev->dsa_ptr is a pointer to a dsa_switch_tree, there is no need > to have another inline helper just to check rcv. > > Remove dsa_uses_tagged_protocol and check dsa_ptr && dsa_ptr->rcv > together at the same time. > > Signed-off-by: Vivien Didelot FYI, the part that matters here is that we know whether the master network device actually uses a tagged DSA protocol, this is important for e.g: bridge (see 8db0a2ee2c6302a1dcbcdb93cb731dfc6c0cdb5e). Some drivers like bcmsysport.c also care about that in order to enable specific switch tagging protocol parsing hints. Reviewed-by: Florian Fainelli > --- > include/net/dsa.h | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/include/net/dsa.h b/include/net/dsa.h > index 58297e4c6b31..4675b52c964c 100644 > --- a/include/net/dsa.h > +++ b/include/net/dsa.h > @@ -467,16 +467,10 @@ struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev); > struct net_device *dsa_dev_to_net_device(struct device *dev); > > /* Keep inline for faster access in hot path */ > -static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst) > -{ > - return dst->rcv != NULL; > -} > - > static inline bool netdev_uses_dsa(struct net_device *dev) > { > #if IS_ENABLED(CONFIG_NET_DSA) > - if (dev->dsa_ptr != NULL) > - return dsa_uses_tagged_protocol(dev->dsa_ptr); > + return dev->dsa_ptr && dev->dsa_ptr->rcv; > #endif > return false; > } > -- Florian