From patchwork Mon May 29 13:00:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9753179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9428A60249 for ; Mon, 29 May 2017 13:00:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 761B328294 for ; Mon, 29 May 2017 13:00:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AD29283CD; Mon, 29 May 2017 13:00:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F11AF28294 for ; Mon, 29 May 2017 13:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750985AbdE2NAo (ORCPT ); Mon, 29 May 2017 09:00:44 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:63662 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913AbdE2NAn (ORCPT ); Mon, 29 May 2017 09:00:43 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lxru4-1e0qov2gce-015FQk; Mon, 29 May 2017 15:00:33 +0200 From: Arnd Bergmann To: Saeed Mahameed , Matan Barak , Leon Romanovsky Cc: Arnd Bergmann , "David S. Miller" , Mohamad Haj Yahia , Daniel Jurgens , Eli Cohen , Aviv Heller , Huy Nguyen , Artemy Kovalyov , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net] net/mlx5: avoid build warning for uniprocessor Date: Mon, 29 May 2017 15:00:17 +0200 Message-Id: <20170529130030.244337-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:2VqGFVZo49V+mMO2evkuZTmEcy0vlJ21zhTdsl8rLQXZPSp96Bg qrhciITr6Ek5LejCp7raEFzOaNu1Uic6kAXwlbyzO+dn2DthaoDTrpgCm9VjFTFZadXk1Vv LuuU/9grvYVzK/wnt0OSoxUVy/HnSAgNcnG6bJvD0FXXK54G9mrksSzWmCj2rSGfMGzxoNs A41hwt+ggkLFC9sBU1jNQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:MxbZDUYaw+0=:2A8/xatuUE4Ran0Fw0RAx5 vFt3VmCYMASu6OMH7enizfWg7lsRSmekRrDxoqOtf0lliyORDhxLrAiuBd91E5X+/r1B2xrBv W8AoCFhk6zy5i41o6FHabAf5XU/cmi7C2VryAjEwUe6QbR6I2I2UVMBlVxrccI7c6lH7HkQ6w gs3b53spKUuYabKMVexwn+lDE925jUTXl3LIqIzq3VuEMD4crCXpvfLywTD6Fec9WGGT7doPg L6SWrj6OoXZm08Jz4oczoDfP6dyB7mJ9bsEC8g/yV7QeqIkfQmg05tOSTnliT87nGNZWLzBCr CGhkJYI1oGTW1RQcTIRg1OZlVcokaamec8AsC42JnMjt8NEaNAdhX9fOS+D1U2aiWJLNnPnMV juIkizZ1FykxU1N/5aph9HcM/M+hXppUXR++dB87n3Y4XhLKlT1pP9mFQI8nZeMs2zNyGDw0q oSl3tz/5NeHYV/VALKXS9ffYwMc45ZHVybtbS/T9bUptt1w/mVvMrmLG4v1ilC1XrHn4xSvxi 9BYjIYA/6wWQHUUuq5CMwYL4V7fR+46u7LOC8c/eZuy3qWU4iaNo06l8XJetbi8FnvvbKjeSJ zgCGadgLTaWlhcR25vwYSjkCDG/3Xq1yK4K+WD0C+cwvtngSzHMjnmntcoG0tztx0wGkUta2K fKZgPC6rwta0nhqpeifi7L9v5AdujkjZmdM8C6SGTWZr1/aZwz2WQdPPHOikQdwV7I7E= Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Building the driver with CONFIG_SMP disabled results in a harmless warning: ethernet/mellanox/mlx5/core/main.c: In function 'mlx5_irq_set_affinity_hint': ethernet/mellanox/mlx5/core/main.c:615:6: error: unused variable 'irq' [-Werror=unused-variable] It's better to express the conditional compilation using IS_ENABLED() here, as that lets the compiler see what the intented use for the variable is, and that it can be silently discarded. Fixes: b665d98edc9a ("net/mlx5: Tolerate irq_set_affinity_hint() failures") igned-off-by: Arnd Bergmann Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 361cd112bb5b..9274d93d3183 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -622,10 +622,9 @@ static int mlx5_irq_set_affinity_hint(struct mlx5_core_dev *mdev, int i) cpumask_set_cpu(cpumask_local_spread(i, priv->numa_node), priv->irq_info[i].mask); -#ifdef CONFIG_SMP - if (irq_set_affinity_hint(irq, priv->irq_info[i].mask)) + if (IS_ENABLED(CONFIG_SMP) && + irq_set_affinity_hint(irq, priv->irq_info[i].mask)) mlx5_core_warn(mdev, "irq_set_affinity_hint failed, irq 0x%.4x", irq); -#endif return 0; }