From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751393AbdIEIGf (ORCPT ); Tue, 5 Sep 2017 04:06:35 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:52981 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750814AbdIEIGb (ORCPT ); Tue, 5 Sep 2017 04:06:31 -0400 From: Arnd Bergmann To: "David S. Miller" , Gavin Shan , Samuel Mendoza-Jonas Cc: Arnd Bergmann , Joel Stanley , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net/ncsi: fix ncsi_vlan_rx_{add,kill}_vid references Date: Tue, 5 Sep 2017 10:05:47 +0200 Message-Id: <20170905080615.1131665-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:yqACGSiIWnJci8Rp6S3BLypM3g1ayLntfV3xK0ZIXTW2bEJyVT3 WqNongs0OBBq+mMUUYWTbc+DVGB5xS2PYX4ZJWupghqtrC6oKXZZxRQ2rxZLTM8U0EX9xfd 4d332odvXL7GdYdDul/yGi0O3CI7rYkof9uhVbPJJmqBvMWnvDOSDvoXLf+w27/Zzi+YFWN 5WU5JawmWwb3uYVSLAc0A== X-UI-Out-Filterresults: notjunk:1;V01:K0:Q15SxZLo8gM=:IivaR3gcnXq3Xza8EGOVx9 992mjTuOLqNYmn74HsSjMqKLqC7hwcebj0Kv2JDbrJs32Mff1kxnhKm6SbQ3hDBKrszGngRAm 5cQEDGR+u4uhWjsx97YUUThe3w0fdzZsBGP2hemyb8JvLKS/fp6VDAuH+NNPqGoEYDQCzvy+2 uDN002YJ13l3sgxGB57vL2/GyirQIFaj3Hd3QZiwo4iQyU3Iwns+EXykxLWn/4hQwupnOFs+4 8R7CkICKc6O8GZxwOfHf4ccX8eA1ofe/qW4nMtooyGZgp9cNkXOyhG2DJoY8pzvNPQ18nD71V UNzMLIN2X5N0DiuB7Sl/bHrMo1heleBdW53qfOxUelghMMzNuxpyoT5bZv2C21Tuy+RR2AI29 xyhZBKAj87NPbDJrqtd636x9/FgDykgpMvD58fraPGvHv3gvIZEh+83O7puVa6HhTxUse1bF0 FuTVWboib242WmgkTq0NkQcW5fPjva+AEtNsjgqGpJ4H1mKVWBxMhLYaETuL2GjY37zfAIhU6 Q92n2W9eCkFP2bnlUooY3lgS0HJB+gsNczfP5O5GJsC0zi273whtPZDZAX7QwhsZQ1pu9JkWp +ZveJZR3mJZU03PhdbmPrKD8RSzYmWSjAHOM8rKo2trStNXwOiQiqNS/aTRcdKTt4sZog5z4d 3lb9XOuCGUY4eoVrsl78f014m7Z/BRwiEhGWs3iy0R1wi+xgsfAOrO6kNtB3ku2SLywJe6CVP MK5Exskk7OvyXyAIv59dFwYqSneZMhwl8G0MPg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We get a new link error in allmodconfig kernels after ftgmac100 started using the ncsi helpers: ERROR: "ncsi_vlan_rx_kill_vid" [drivers/net/ethernet/faraday/ftgmac100.ko] undefined! ERROR: "ncsi_vlan_rx_add_vid" [drivers/net/ethernet/faraday/ftgmac100.ko] undefined! Related to that, we get another error when CONFIG_NET_NCSI is disabled: drivers/net/ethernet/faraday/ftgmac100.c:1626:25: error: 'ncsi_vlan_rx_add_vid' undeclared here (not in a function); did you mean 'ncsi_start_dev'? drivers/net/ethernet/faraday/ftgmac100.c:1627:26: error: 'ncsi_vlan_rx_kill_vid' undeclared here (not in a function); did you mean 'ncsi_vlan_rx_add_vid'? This fixes both problems at once, using a 'static inline' stub helper for the disabled case, and exporting the functions when they are present. Fixes: 51564585d8c6 ("ftgmac100: Support NCSI VLAN filtering when available") Fixes: 21acf63013ed ("net/ncsi: Configure VLAN tag filter") Signed-off-by: Arnd Bergmann --- include/net/ncsi.h | 10 ++++++++++ net/ncsi/ncsi-manage.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/include/net/ncsi.h b/include/net/ncsi.h index 1f96af46df49..fdc60ff2511d 100644 --- a/include/net/ncsi.h +++ b/include/net/ncsi.h @@ -36,6 +36,16 @@ int ncsi_start_dev(struct ncsi_dev *nd); void ncsi_stop_dev(struct ncsi_dev *nd); void ncsi_unregister_dev(struct ncsi_dev *nd); #else /* !CONFIG_NET_NCSI */ +static inline int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) +{ + return -EINVAL; +} + +static inline int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) +{ + return -EINVAL; +} + static inline struct ncsi_dev *ncsi_register_dev(struct net_device *dev, void (*notifier)(struct ncsi_dev *nd)) { diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 11904b3b702d..3fd3c39e6278 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -1453,6 +1453,7 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) return found ? ncsi_process_next_channel(ndp) : 0; } +EXPORT_SYMBOL_GPL(ncsi_vlan_rx_add_vid); int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) { @@ -1491,6 +1492,7 @@ int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) return found ? ncsi_process_next_channel(ndp) : 0; } +EXPORT_SYMBOL_GPL(ncsi_vlan_rx_kill_vid); struct ncsi_dev *ncsi_register_dev(struct net_device *dev, void (*handler)(struct ncsi_dev *ndev)) -- 2.9.0