From patchwork Tue Oct 30 07:31:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12572 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C8B7023F6F for ; Tue, 30 Oct 2012 07:31:03 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 52ECEA18E98 for ; Tue, 30 Oct 2012 07:31:03 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so4364456iag.11 for ; Tue, 30 Oct 2012 00:31:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=RDVxepMVC4FHQVHLzo3FirX9YCm9QJW38UYo48qk8ZI=; b=hizVRTNVACYFOLFswaMK2pzwgjAyvyEua+W8wKKGWXPB6odcrltQzlcGphU/TwynR8 w7+M140sgs29cPx2lrYGlFWz93qYbulh1jXbLs8YmF8YOL+CqJ+KekCrxKFGtkgKbaYG zHH0m11rdYv8vB24Ky2b5zmNKv/f46RNGzHrVv0AjdtxgRRUc/3WGqSb+AnKBqujcnlI h6q0vfIdfSGC0n4oR/W/sKG4Sj96OZnsVLLI9szewGzavig7LpLi7xpwhAS1WZhsUwIr 4+o0uWhAvTiHAbifhMSCfPj3kvfVo6Ddb3M/L3BsYNxmiiF7H+JBNy6Z6lwg9x9Cx790 TemA== Received: by 10.50.91.195 with SMTP id cg3mr620551igb.57.1351582262666; Tue, 30 Oct 2012 00:31:02 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp353520igt; Tue, 30 Oct 2012 00:31:02 -0700 (PDT) Received: by 10.50.47.201 with SMTP id f9mr631096ign.44.1351582261943; Tue, 30 Oct 2012 00:31:01 -0700 (PDT) Received: from mail-ia0-f178.google.com (mail-ia0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id pr8si8616971igb.73.2012.10.30.00.31.01 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 30 Oct 2012 00:31:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) smtp.mail=viresh.kumar@linaro.org Received: by mail-ia0-f178.google.com with SMTP id y26so5679345iab.37 for ; Tue, 30 Oct 2012 00:31:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.47.234 with SMTP id g10mr671361ign.16.1351582261503; Tue, 30 Oct 2012 00:31:01 -0700 (PDT) Received: by 10.64.136.210 with HTTP; Tue, 30 Oct 2012 00:31:01 -0700 (PDT) In-Reply-To: References: <5afab1ebe83e4361f1fd75bbea0c559af195bf02.1351529738.git.viresh.kumar@linaro.org> <1351540778.2721.7.camel@bwh-desktop.uk.solarflarecom.com> Date: Tue, 30 Oct 2012 13:01:01 +0530 Message-ID: Subject: Re: [PATCH] net: dsa/slave: Fix compilation warnings From: Viresh Kumar To: Ben Hutchings Cc: davem@davemloft.net, linaro-dev@lists.linaro.org, patches@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Gm-Message-State: ALoCoQkhSZPXR6DadJdiTFK4BaivTDNVW34bgAU8s3c4G2SEOAz6XCI1HCoDsJu2k/GsRmvg9KR1 On 30 October 2012 12:15, Viresh Kumar wrote: > And so, if we select NET_DSA from these tagging drivers, then only slave.c will > get compiled. Otherwise slave.c dsa.c dsa_core.c wouldn't be compiled and so > no warnings. If my above explanation/assumption is correct, then please review following patch: --------------------------x-----------------------x---------------- From: Viresh Kumar Date: Mon, 29 Oct 2012 22:19:14 +0530 Subject: [PATCH] net: dsa/slave: Fix compilation warnings Currently when none of CONFIG_NET_DSA_TAG_DSA, CONFIG_NET_DSA_TAG_EDSA and CONFIG_NET_DSA_TAG_TRAILER is defined, we get following compilation warnings: net/dsa/slave.c:51:12: warning: 'dsa_slave_init' defined but not used [-Wunused-function] net/dsa/slave.c:60:12: warning: 'dsa_slave_open' defined but not used [-Wunused-function] net/dsa/slave.c:98:12: warning: 'dsa_slave_close' defined but not used [-Wunused-function] net/dsa/slave.c:116:13: warning: 'dsa_slave_change_rx_flags' defined but not used [-Wunused-function] net/dsa/slave.c:127:13: warning: 'dsa_slave_set_rx_mode' defined but not used [-Wunused-function] net/dsa/slave.c:136:12: warning: 'dsa_slave_set_mac_address' defined but not used [-Wunused-function] net/dsa/slave.c:164:12: warning: 'dsa_slave_ioctl' defined but not used [-Wunused-function] Earlier approach to fix this was discussed here: lkml.org/lkml/2012/10/29/549 This is another approach to fix it. This is done by some changes in config options, which make more sense than the earlier approach. As, atleast one tagging option must always be selected for using net/dsa/ infrastructure, this patch selects NET_DSA from tagging configs instead of having it as an selectable config. Signed-off-by: Viresh Kumar --- drivers/net/dsa/Kconfig | 1 - net/dsa/Kconfig | 16 +++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig index dd151d5..96eae22 100644 --- a/drivers/net/dsa/Kconfig +++ b/drivers/net/dsa/Kconfig @@ -1,5 +1,4 @@ menu "Distributed Switch Architecture drivers" - depends on NET_DSA config NET_DSA_MV88E6XXX tristate diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig index 274791c..f7c6cef 100644 --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig @@ -1,5 +1,5 @@ config NET_DSA - tristate "Distributed Switch Architecture support" + tristate default n depends on EXPERIMENTAL && NETDEVICES && !S390 select PHYLIB @@ -8,19 +8,21 @@ config NET_DSA the Distributed Switch Architecture. -if NET_DSA +menu "Distributed Switch Architecture support" # tagging formats config NET_DSA_TAG_DSA - bool + bool "Original DSA packet tagging format" + select NET_DSt default n config NET_DSA_TAG_EDSA - bool + bool "Ethertype DSA packet tagging format" + select NET_DSA default n config NET_DSA_TAG_TRAILER - bool + bool "Trailer DSA packet tagging format" + select NET_DSA default n - -endif +endmenu