Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751815AbeAPNvq (ORCPT + 1 other); Tue, 16 Jan 2018 08:51:46 -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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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; -- 2.9.0