From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBBEEC3A59F for ; Thu, 29 Aug 2019 16:15:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9293C21874 for ; Thu, 29 Aug 2019 16:15:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728237AbfH2QP3 (ORCPT ); Thu, 29 Aug 2019 12:15:29 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:46491 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727008AbfH2QP2 (ORCPT ); Thu, 29 Aug 2019 12:15:28 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from vladbu@mellanox.com) with ESMTPS (AES256-SHA encrypted); 29 Aug 2019 19:15:24 +0300 Received: from reg-r-vrt-018-180.mtr.labs.mlnx. (reg-r-vrt-018-180.mtr.labs.mlnx [10.215.1.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x7TGFNlu031066; Thu, 29 Aug 2019 19:15:24 +0300 From: Vlad Buslov To: netdev@vger.kernel.org Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, saeedm@mellanox.com, idosch@mellanox.com, sergei.shtylyov@cogentembedded.com, Vlad Buslov , tanhuazhong Subject: [PATCH net-next v2 2/2] net/mlx5e: Move local var definition into ifdef block Date: Thu, 29 Aug 2019 19:15:17 +0300 Message-Id: <20190829161517.20935-3-vladbu@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190829161517.20935-1-vladbu@mellanox.com> References: <20190829161517.20935-1-vladbu@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org New local variable "struct flow_block_offload *f" was added to mlx5e_setup_tc() in recent rtnl lock removal patches. The variable is used in code that is only compiled when CONFIG_MLX5_ESWITCH is enabled. This results compilation warning about unused variable when CONFIG_MLX5_ESWITCH is not set. Move the variable definition into eswitch-specific code block from the beginning of mlx5e_setup_tc() function. Fixes: c9f14470d048 ("net: sched: add API for registering unlocked offload block callbacks") Reported-by: tanhuazhong Signed-off-by: Vlad Buslov --- Notes: Changes V1 -> V2: - Fixed error in commit message. drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 8592b98d0e70..c10a1fc8e469 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -3470,16 +3470,18 @@ static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type, void *type_data) { struct mlx5e_priv *priv = netdev_priv(dev); - struct flow_block_offload *f = type_data; switch (type) { #ifdef CONFIG_MLX5_ESWITCH - case TC_SETUP_BLOCK: + case TC_SETUP_BLOCK: { + struct flow_block_offload *f = type_data; + f->unlocked_driver_cb = true; return flow_block_cb_setup_simple(type_data, &mlx5e_block_cb_list, mlx5e_setup_tc_block_cb, priv, priv, true); + } #endif case TC_SETUP_QDISC_MQPRIO: return mlx5e_setup_tc_mqprio(priv, type_data); -- 2.21.0