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: 124700 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1020531lje; Tue, 16 Jan 2018 05:51:48 -0800 (PST) X-Google-Smtp-Source: ACJfBotYm+bKzXJZnNcVtTBNVxVfWWACv02Gh59YOZpWZika6KzqTcO6Md6ijI2uOf+Sxc7mrhKA X-Received: by 10.159.251.136 with SMTP id m8mr17717781pls.432.1516110707914; Tue, 16 Jan 2018 05:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516110707; cv=none; d=google.com; s=arc-20160816; b=cdCjnxyFuXDNA/22eujq3XQW3S1dWGfMx3B71s/33T5lCsc2x0BCQw1frNDTFhc3pa y2bKd6OidcgKOBQqWIUmNA7on5n/gIh02RwYGrw5jTbza+KXRtq4mX/8jWlmKRVfryGK ggMcClhThkpeM3bfsicvuS8LKIk6+XR7q1HzhI56WfrY67YTy3rzuWE+sf1fcUMqcv3c HwcasAYIWjG9/J7TU1eti1gCQ6TLzBcnSQXXy0I4Z76qDoaZ7vVaye6EGl9hjMkDwGnl 01ltszBXpxrJDGwv7+CrgEeUgYsV2VKLuAM6SsClYjWL8ZMQsCLTXmCupotq0bsgLj8N RMtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wykNV55fSs9yeBzh5pjWSCV0Ra/ESCCzv6BXWc3i4WI=; b=yETLtv0cKOmj910U/cg7hQkZ7Okc8IEA5m6CZd3FxFmMLsDHs/mXUi8+mXLqNzQt7e wdnJ+xg0xRGdwdHkyvW1MNbfnv0vqrQd7GuyefFC2ad3J8bmagXs2QIGzQgfPvdH3btD gJZZxOpYUX9sCltJM+bsHTpKigAx2ElfW5d/aLb0jwGxM6w3EeMwkCfhoUtj5nzo6Atj qDvcx5KBCAfW69I66jf31n5f2vYLwytV2O2orGhuAci5wtR0pk1OeEBC42S1L/dOMSiD xxkBUKypEa2fmRGImNWpEDN541lL3mtj2QvfyXgDErbLtzwbYkBEiROE1o5wYtkFuzBZ lPBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si1674310pgo.182.2018.01.16.05.51.47; Tue, 16 Jan 2018 05:51:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751815AbeAPNvq (ORCPT + 28 others); 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 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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;