From patchwork Sun Sep 18 08:39:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 76450 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp444767qgf; Sun, 18 Sep 2016 01:40:15 -0700 (PDT) X-Received: by 10.98.67.139 with SMTP id l11mr21102166pfi.16.1474188015322; Sun, 18 Sep 2016 01:40:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p77si56853073pfk.199.2016.09.18.01.40.15; Sun, 18 Sep 2016 01:40:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755543AbcIRIkM (ORCPT + 27 others); Sun, 18 Sep 2016 04:40:12 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:33703 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753764AbcIRIkI (ORCPT ); Sun, 18 Sep 2016 04:40:08 -0400 Received: by mail-pf0-f174.google.com with SMTP id 21so30024265pfy.0 for ; Sun, 18 Sep 2016 01:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=98RVVcFMtHvjpxAIpjhYp0zLkbMT1Cit0mNOCe+xYHk=; b=XEVG7riBcSACPRRevGBcLRjTs6cmYiDy0a2Y25DIrcpnj5snrMfiPLwbmrXLofdjdD ILLjetP/Q2GcjwA9i/SVXd1/rzy2SPer60b1a1QZ2z2+DIQlCD6XTxrANfhytWNW6IFy nNtKLzS6ykQXRuFmBoCqMiJ+9rR3aGnQ/UIBg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=98RVVcFMtHvjpxAIpjhYp0zLkbMT1Cit0mNOCe+xYHk=; b=kSk60SOIlaVsuLUKWtDZPjVUpuAigT9+8AHh4Hv+DijrEfryH1QGkNNAtM3SmxR/xv 1kU5RDOdD8hVhO1c+uGt5lp9IpwPrWvERAYK3HKBXG8ZTGfHGm7qz6axVkRJYn5OFSIy 7X1YXvo6brB3bJpSREordHyFEnXoBYmaDO2gHLmFwv8XGjSNPB1SvSBsIQ5rezKmsEZm SutSWTFmEfrV16C03ff3l7oFWFWhiHWWQ4JX3ldk23mVCdF/pf5PV6r5jaghJxE+/5ye oB8A5fZDBcz42czNixv0axr6a7EPwS9bn1URzNkhHdsUGTmjU7P/gEJ5ik1ajJX7cpRp ebAQ== X-Gm-Message-State: AE9vXwMawYF2qEzB0XQID6K0cql667hO7pUevwv5QKTpL5nf3MBobegNRAR1xyrNMY/VbUL4 X-Received: by 10.98.87.90 with SMTP id l87mr37150067pfb.133.1474188007677; Sun, 18 Sep 2016 01:40:07 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.27]) by smtp.gmail.com with ESMTPSA id q8sm23171135pac.32.2016.09.18.01.40.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Sep 2016 01:40:07 -0700 (PDT) From: Baoyou Xie To: jiri@mellanox.com, idosch@mellanox.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de, baoyou.xie@linaro.org, xie.baoyou@zte.com.cn Subject: [PATCH] mlxsw: spectrum: mark symbols static where possible Date: Sun, 18 Sep 2016 16:39:47 +0800 Message-Id: <1474187987-12958-1-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We get 3 warnings when building kernel with W=1: drivers/net/ethernet/mellanox/mlxsw/spectrum.c:251:29: warning: no previous prototype for 'mlxsw_sp_span_entry_find' [-Wmissing-prototypes] drivers/net/ethernet/mellanox/mlxsw/spectrum.c:265:29: warning: no previous prototype for 'mlxsw_sp_span_entry_get' [-Wmissing-prototypes] drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:1749:6: warning: no previous prototype for 'mlxsw_sp_fib_entry_put' [-Wmissing-prototypes] In fact, these functions are only used in the file in which they are declared and don't need a declaration, but can be made static. so this patch marks these functions with 'static'. Signed-off-by: Baoyou Xie --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 ++++-- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 1162e04..e680193 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -248,7 +248,8 @@ static void mlxsw_sp_span_entry_destroy(struct mlxsw_sp *mlxsw_sp, span_entry->used = false; } -struct mlxsw_sp_span_entry *mlxsw_sp_span_entry_find(struct mlxsw_sp_port *port) +static struct +mlxsw_sp_span_entry *mlxsw_sp_span_entry_find(struct mlxsw_sp_port *port) { struct mlxsw_sp *mlxsw_sp = port->mlxsw_sp; int i; @@ -262,7 +263,8 @@ struct mlxsw_sp_span_entry *mlxsw_sp_span_entry_find(struct mlxsw_sp_port *port) return NULL; } -struct mlxsw_sp_span_entry *mlxsw_sp_span_entry_get(struct mlxsw_sp_port *port) +static struct +mlxsw_sp_span_entry *mlxsw_sp_span_entry_get(struct mlxsw_sp_port *port) { struct mlxsw_sp_span_entry *span_entry; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 352259b..82cdeba 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -1746,8 +1746,8 @@ mlxsw_sp_fib_entry_find(struct mlxsw_sp *mlxsw_sp, fib4->fi->fib_dev); } -void mlxsw_sp_fib_entry_put(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_fib_entry *fib_entry) +static void mlxsw_sp_fib_entry_put(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_fib_entry *fib_entry) { struct mlxsw_sp_vr *vr = fib_entry->vr;