From patchwork Mon Oct 29 16:57:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 195073 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D9D6B2C0084 for ; Tue, 30 Oct 2012 03:58:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760060Ab2J2Q6O (ORCPT ); Mon, 29 Oct 2012 12:58:14 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:43406 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759406Ab2J2Q6M (ORCPT ); Mon, 29 Oct 2012 12:58:12 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so4391592pbb.19 for ; Mon, 29 Oct 2012 09:58:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=MJJUm1wQIOiHQ07+PJFG+EIEg73xU2BisfYrv3gsavo=; b=K/IUuSYW25injD0SxGrJRRP0WJxQZe9hJ4UGTyJ+4UsRQ+/LN2iVoFOxR1kgoOrkCX KqaP6QxeX/gWpylZjJVnQmSeKjgRJrSVBUd41DYkukTj2SR8C62uLXqP7TJEw2OuUFhe IG0viPhaM1W+R6Aa3Ns+I0x+Ro1Vp6zplk2UCPmDM740Y1Zd6+xnD8fOcaUbQjlIox9P F72VQtSUhaAgkJ2mZ2GwHPCHltrhHl9+RYrMtdv+NSORjPDsWt4mS80gIh2+UdKTX8Ze CTTYiRop6U2zi3pAugQuLMJTlIhF27uu1A3W5ijmdaKZzRiuXhT9zTSp+lynoH3K8mfk 7DuA== Received: by 10.68.204.34 with SMTP id kv2mr11035846pbc.136.1351529891601; Mon, 29 Oct 2012 09:58:11 -0700 (PDT) Received: from localhost ([122.166.182.101]) by mx.google.com with ESMTPS id wf8sm6243574pbc.65.2012.10.29.09.58.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 09:58:09 -0700 (PDT) From: Viresh Kumar To: davem@davemloft.net Cc: linaro-dev@lists.linaro.org, patches@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH] net: dsa/slave: Fix compilation warnings Date: Mon, 29 Oct 2012 22:27:56 +0530 Message-Id: <5afab1ebe83e4361f1fd75bbea0c559af195bf02.1351529738.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Gm-Message-State: ALoCoQkQ0ODy4o3peu7A4hTHIgNK8jmmarK4H31w/cPFFLXmYQ1EUt7sZf7gtHiRYel+UtjvwXKu Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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] Fix them by enclosing these routines under #ifdef,endif. Signed-off-by: Viresh Kumar --- net/dsa/slave.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index e32083d..5606fae 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -48,6 +48,8 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds) /* slave device handling ****************************************************/ +#if defined(CONFIG_NET_DSA_TAG_DSA) || defined(CONFIG_NET_DSA_TAG_EDSA) || \ + defined(CONFIG_NET_DSA_TAG_TRAILER) static int dsa_slave_init(struct net_device *dev) { struct dsa_slave_priv *p = netdev_priv(dev); @@ -170,6 +172,8 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return -EOPNOTSUPP; } +#endif /* defined(CONFIG_NET_DSA_TAG_DSA) || defined(CONFIG_NET_DSA_TAG_EDSA || + defined(CONFIG_NET_DSA_TAG_TRAILER) */ /* ethtool operations *******************************************************/