From patchwork Tue Jan 16 13:50:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10167057 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 06BE360325 for ; Tue, 16 Jan 2018 13:52:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEC8628179 for ; Tue, 16 Jan 2018 13:52:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E332428210; Tue, 16 Jan 2018 13:52:45 +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 0DC75285DA for ; Tue, 16 Jan 2018 13:51:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751626AbeAPNvp (ORCPT ); Tue, 16 Jan 2018 08:51:45 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:64609 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbeAPNvo (ORCPT ); Tue, 16 Jan 2018 08:51:44 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0M3B4h-1ersP01Oxb-00ssBu; Tue, 16 Jan 2018 14:51:21 +0100 From: Arnd Bergmann To: Kurt Schwemmer , Logan Gunthorpe , Jon Mason , Dave Jiang , Allen Hubbe Cc: Arnd Bergmann , Stephen Bates , linux-pci@vger.kernel.org, linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH] [RESEND] ntb_hw_switchtec: fix logic error Date: Tue, 16 Jan 2018 14:50:51 +0100 Message-Id: <20180116135116.4065102-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:pqNB6wAqoeM9VGRcDPUFAdjKK7ZU65mulfViljlt6abnBansXYF 7+6ceglmb6U0u4SuSrEQagVAM9Dul3ND7mPCxO7oX/NLlN42vjWth+yI0d921oCLuXcmHUI Gdk50s2D2Kfm4NiRKaHRqUDZB4pIdiQX6iQnq08fdLPW1DRsxpEe0UQNqJfuakX0HdyVw3t vPj1X5SpT5lv6oyKzyjFA== X-UI-Out-Filterresults: notjunk:1; V01:K0:R8unNx98DCc=:LfKNyOMVcBJrPYMeh7CP0j Esw+S0bS69YE4n5rDm4vt4WUVOX8pMO1+EexOuNVucncMKhXLAU9C6lZOVQPSkLKm/J+2vSYo iW/VRTeP8S7WVjztythkhH1QVh/SAni75LFwEZfyBJNiv2Jr6FM2996nBZu5JmMUCs81REWq9 Dn/E1m4bQ+abYHJ8HxxCcxC+XfEi77hcEOFsIJ919Y8AXv4Gzq6HhVInHZ+JPfp9NCvZUnoTK gvt2fTt6FKEUC2j7FMFKwcDdDj34G/vadMLFB4Urcb4NYHTzQ3RaAUpOIoQefmA+TwLIrqkd7 PI3mTd+dmTZb/R6ufK6xjHyeznTwcVFc09dVbM6q8DDcHzUpV05qRoNdtWVsE3U8zvfsnyuK3 67hi8cZfBindgiaNLG3N4rykAb7Fj9gZMC1B4GkMqYp+i9ldSDzRDviw9dHKOnrVCWJUptxYp 12UxMKcGydqfr/Uo7vrqHywS/0hOy9I7XtEp7lYAnHD0Zaph9+7/1zJKoYqAp8r7U5a3Z/eRk 50ZC11M99QL6bxJMzWnwhs3kNyHJx9PkJVTcPSJ4T9iJDgLQnoINZWQ2xUi/GQgNbCis7BKEK k/bnEGn/mtCQk7xKgC4XcT6DSahFKNDEO1V8F8JoKSZ8urn6gkUBXFVBBIH15b6b9QVaACY1x Zlik46qxJ4fu9wBuOrblkfTwadYjTjOt9MFeL3XuSw6YaizHD0mD8ylBLIwk4siTypuB0N9Cd wisIWk6kiXkqBiuzVImlvuofTlS+wIL/BWxByQ== 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") Reviewed-by: Logan Gunthorpe Signed-off-by: Arnd Bergmann ---- Originally sent on Dec 9, but this patch never got picked up --- 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;