Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751321AbdFAUK0 (ORCPT ); Thu, 1 Jun 2017 16:10:26 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:52896 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbdFAUJ1 (ORCPT ); Thu, 1 Jun 2017 16:09:27 -0400 From: Vivien Didelot To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli , Andrew Lunn , Vivien Didelot Subject: [PATCH net-next v3 3/5] net: dsa: remove dsa_uses_tagged_protocol Date: Thu, 1 Jun 2017 16:07:13 -0400 Message-Id: <20170601200715.8438-4-vivien.didelot@savoirfairelinux.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170601200715.8438-1-vivien.didelot@savoirfairelinux.com> References: <20170601200715.8438-1-vivien.didelot@savoirfairelinux.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 36 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. Reviewed-by: Florian Fainelli Signed-off-by: Vivien Didelot --- 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 18ca0a935c96..448d8bc77707 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -468,16 +468,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; } -- 2.13.0