From patchwork Wed Feb 17 22:25:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8343451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 347FBC0553 for ; Wed, 17 Feb 2016 22:28:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96EDC2026C for ; Wed, 17 Feb 2016 22:28:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08750201DD for ; Wed, 17 Feb 2016 22:28:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWAY8-0006oL-LB; Wed, 17 Feb 2016 22:26:20 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWAY4-0006lE-EQ for linux-arm-kernel@lists.infradead.org; Wed, 17 Feb 2016 22:26:17 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LvBCM-1ZoTlu0Lli-010P8F; Wed, 17 Feb 2016 23:25:48 +0100 From: Arnd Bergmann To: Oliver Neukum Subject: [PATCH] USB: cdc_subset: only build when one driver is enabled Date: Wed, 17 Feb 2016 23:25:11 +0100 Message-Id: <1455747932-2844084-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:g8bdSlo3PVrhtRwJQlQM5TIjszpD8UwuBkTei4fYvX3ENmOveT4 gOEZgmtCuYeSfyHpniam7hYi0FyUMqHjxVYiBSp5Qi4PSH40hGg4TX+QSmS0Wv9SSgnE0l9 M3cWtF2/m0FpaHqC0WEI3ZFIqE9rvYuVvqFvnWNBhR7ciwqwjIOqL/kA+SkC6sxTANw//qE c7TvpKRkXv47PxXDx6grA== X-UI-Out-Filterresults: notjunk:1; V01:K0:grIW86go0Dc=:FvdvRfWA+W2lBCFTvsPmsA taYPcFfCLZPfE0xA0tienDbWtkwnufgCw3/g7QVWI5qq0T2cNfJxnmUf0T/9WpMqqTivGBdv9 FdgSGZVvTDfe7H1ifse8+HMqdduNAXk/Nm9jtqCqKdasAi55f/yFRBNru8XpTaNZehC2pnLlN z7s1PJ8MNNI9mFQZbYPZpQh1dUvKUV5vYvxAX9xu433Tg+Hdv0uw6LJbEwUNdzgWXiw8d3Rth j2EejcQlnWDvq03vnvX2nmhOxgLQZFdfo9iERWt0OS/xTuRWwC+bakg4jBW+CYSMMerkHjWbn qVIt7KnIemmyW+YnadvMWDlNcppxJtzkM53LKgqbMLLEpTrW4y7j84LYkeLsHJdxz3O3vbedy +L+c8eWZvtEKVX9kPgIg6PlkgEuSdANwoYgh1NDgmCzBLRzOCrEKfLhU/D2+gGhGQd4ADEz9+ GDN1oVWIRyZr421toJ9iotLeU56qHni2dNTTCjKYJolr0SfqKDmEGcu388sVMwp+r3R9ocank 34hzr8JUXJAfq9wqMvC6+Ln2NHZl8emhhjLez41rkN+sdUsUfNE2Ocyulh5mefrVCBfHX+dU2 udkMVvGp5u5Bc7xTmr1V1oJ9DbYnlMdmHXPiEQp0C/vjX72ex/Cx0tX1zIMpIOZ7m4vCIlse+ 21BWwt8eW1j5WBjwcqsv2eg4C0ZFOLpEEeAL6GBgcrpf18aAQzxm2WAUc7zALZEuClt8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160217_142616_836672_BE617200 X-CRM114-Status: GOOD ( 14.26 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This avoids a harmless randconfig warning I get when USB_NET_CDC_SUBSET is enabled, but all of the more specific drivers are not: drivers/net/usb/cdc_subset.c:241:2: #warning You need to configure some hardware for this driver The current behavior is clearly intentional, giving a warning when a user picks a configuration that won't do anything good. The only reason for even addressing this is that I'm getting close to eliminating all 'randconfig' warnings on ARM, and this came up a couple of times. My workaround is to not even build the module when none of the configurations are enable. Alternatively we could simply remove the #warning (nothing wrong for compile-testing), turn it into a runtime warning, or change the Kconfig options into a menu to hide CONFIG_USB_NET_CDC_SUBSET. Signed-off-by: Arnd Bergmann --- drivers/net/usb/Kconfig | 10 ++++++++++ drivers/net/usb/Makefile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 7f83504dfa69..cdde59089f72 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -395,6 +395,10 @@ config USB_NET_RNDIS_HOST The protocol specification is incomplete, and is controlled by (and for) Microsoft; it isn't an "Open" ecosystem or market. +config USB_NET_CDC_SUBSET_ENABLE + tristate + depends on USB_NET_CDC_SUBSET + config USB_NET_CDC_SUBSET tristate "Simple USB Network Links (CDC Ethernet subset)" depends on USB_USBNET @@ -413,6 +417,7 @@ config USB_NET_CDC_SUBSET config USB_ALI_M5632 bool "ALi M5632 based 'USB 2.0 Data Link' cables" depends on USB_NET_CDC_SUBSET + select USB_NET_CDC_SUBSET_ENABLE help Choose this option if you're using a host-to-host cable based on this design, which supports USB 2.0 high speed. @@ -420,6 +425,7 @@ config USB_ALI_M5632 config USB_AN2720 bool "AnchorChips 2720 based cables (Xircom PGUNET, ...)" depends on USB_NET_CDC_SUBSET + select USB_NET_CDC_SUBSET_ENABLE help Choose this option if you're using a host-to-host cable based on this design. Note that AnchorChips is now a @@ -428,6 +434,7 @@ config USB_AN2720 config USB_BELKIN bool "eTEK based host-to-host cables (Advance, Belkin, ...)" depends on USB_NET_CDC_SUBSET + select USB_NET_CDC_SUBSET_ENABLE default y help Choose this option if you're using a host-to-host cable @@ -437,6 +444,7 @@ config USB_BELKIN config USB_ARMLINUX bool "Embedded ARM Linux links (iPaq, ...)" depends on USB_NET_CDC_SUBSET + select USB_NET_CDC_SUBSET_ENABLE default y help Choose this option to support the "usb-eth" networking driver @@ -454,6 +462,7 @@ config USB_ARMLINUX config USB_EPSON2888 bool "Epson 2888 based firmware (DEVELOPMENT)" depends on USB_NET_CDC_SUBSET + select USB_NET_CDC_SUBSET_ENABLE help Choose this option to support the usb networking links used by some sample firmware from Epson. @@ -461,6 +470,7 @@ config USB_EPSON2888 config USB_KC2190 bool "KT Technology KC2190 based cables (InstaNet)" depends on USB_NET_CDC_SUBSET + select USB_NET_CDC_SUBSET_ENABLE help Choose this option if you're using a host-to-host cable with one of these chips. diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index b5f04068dbe4..37fb46aee341 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -23,7 +23,7 @@ obj-$(CONFIG_USB_NET_GL620A) += gl620a.o obj-$(CONFIG_USB_NET_NET1080) += net1080.o obj-$(CONFIG_USB_NET_PLUSB) += plusb.o obj-$(CONFIG_USB_NET_RNDIS_HOST) += rndis_host.o -obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o +obj-$(CONFIG_USB_NET_CDC_SUBSET_ENABLE) += cdc_subset.o obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o obj-$(CONFIG_USB_USBNET) += usbnet.o