From patchwork Wed Dec 6 14:19:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10095951 X-Patchwork-Delegate: bhelgaas@google.com 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 7DB0D60210 for ; Wed, 6 Dec 2017 14:19:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7185A28AC5 for ; Wed, 6 Dec 2017 14:19:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6640129B7A; Wed, 6 Dec 2017 14:19:58 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 18F0028AC5 for ; Wed, 6 Dec 2017 14:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752546AbdLFOTv (ORCPT ); Wed, 6 Dec 2017 09:19:51 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:59290 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752524AbdLFOTt (ORCPT ); Wed, 6 Dec 2017 09:19:49 -0500 Received: from wuerfel.lan ([149.172.96.106]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0LzCr3-1f8SBt0isj-014UfW; Wed, 06 Dec 2017 15:19:28 +0100 From: Arnd Bergmann To: Kurt Schwemmer , Logan Gunthorpe , Jon Mason , Dave Jiang , Allen Hubbe Cc: Arnd Bergmann , Stephen Bates , Colin Ian King , Doug Meyer , Kelvin Cao , linux-pci@vger.kernel.org, linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH] ntb_hw_switchtec: fix logic error Date: Wed, 6 Dec 2017 15:19:03 +0100 Message-Id: <20171206141923.817850-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:/oPS/8y23KJZ24Fq+4fXaMtW0dTp9sdN/shapwXSkAzv5ZkDyL2 +CMqnV+9Cn8fVO9jzttPvQYz2i9y2loBhXK6029+W9nZ987w9mGzhxjdbZEgcHqDpeRl3s8 H28KBpKE2Y+1Na8uIPXbFidEO6IUFFspXuZorD0Q+dh/WSWuAgLD3MvPT1Dl8K5eqwO4i01 5lGsFcJsCzOM+V0YgaAvg== X-UI-Out-Filterresults: notjunk:1; V01:K0:M/RK+iP46mE=:QzW8u9kdCKwgvJozIsbmjf upBGCaWoBpxot54qDwIfSHZojRHvShOVSxFbT4Fp2Za9psn/B+RkFwxzicUahnQE6GNjr0S7i E50oXRZitj+yA2hsHMF/lFGYVBUQfeE1b/v0tKuuF85ZN6jUKr1r8KkYRM2/CybYZz05xKBWf JBB/wexuON4ORAY3fEWKCEFSEkC0frPQ9thltod0DYO2i8w7Zd8T1qJQOgx8Czcx41vtHBWmY aUeFVbENihyH9OTm7aOPlKkp/lSqwUpJ+XZbBDhF37TKkuBxRHoOnCnSyo1Q4A0JtrN9GCn06 NXZ6huGampaYHmoR0S03GzdJyKIavzv57QKGY2REohrzyFqKWP+bHHesCpJn4sFK7HwPi6YmX 5ZbtxSnPt2CzwCc6lNaOhPZkuLM2PD9Ct50XEZ8xGw8p5ejjdeQgq4VBh9kUhrTYPFI97SRqp PBn6HxxyC+PAahNpnWHQOTrMPmxtWsRBh9TvxneM/+JxV0WMX+LcqM75oICP/OTaQgJCOyq/e USt9Nj3veFgLkEAxO6ZCrgMbhIRsAlk0o54O34PKR2CZwkkIWVsKCP0wpGuWcqhc5yNVs2RvI cAP2goeW3f7oHSeCkygQe4I5R32iuyT31UoC7xeHyYuPF+9OoK0y5himWN2LP1zus9NyqQjqw nLghjc4Ns+xXghKCfT0AUAyixxYSRBRY7yvu4zE72rdKGrIIAPRkIxoG4CYYY/YWwc61x8SwH T/4f8QW+qnbwnpyQBsUcT5vLE3Akt1OA87wq3A== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Newer gcc (version 7 and 8 presumably) warn about a statement mixing the << operator with logical and: drivers/ntb/hw/mscc/ntb_hw_switchtec.c: In function 'switchtec_ntb_init_sndev': drivers/ntb/hw/mscc/ntb_hw_switchtec.c:888:24: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context] My interpretation here is that the author must have intended a bitmask rather than a comparison, so I'm changing the '&&' to '&', which makes a lot more sense in the context. Fixes: 1b249475275d ("ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups") Signed-off-by: Arnd Bergmann Reviewed-by: Logan Gunthorpe --- drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c index bcd5b6fb3800..76acb8bba3f2 100644 --- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c +++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c @@ -885,7 +885,7 @@ static int switchtec_ntb_init_sndev(struct switchtec_ntb *sndev) } sndev->peer_partition = ffs(tpart_vec) - 1; - if (!(part_map && (1 << sndev->peer_partition))) { + if (!(part_map & (1 << sndev->peer_partition))) { dev_err(&sndev->stdev->dev, "ntb target partition is not NT partition\n"); return -ENODEV;