From: Jon Mason <jdmason@kudzu.us>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Kurt Schwemmer <kurt.schwemmer@microsemi.com>,
Logan Gunthorpe <logang@deltatee.com>,
Dave Jiang <dave.jiang@intel.com>,
Allen Hubbe <Allen.Hubbe@emc.com>,
Stephen Bates <sbates@raithlin.com>,
linux-pci@vger.kernel.org, linux-ntb@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [RESEND] ntb_hw_switchtec: fix logic error
Date: Thu, 18 Jan 2018 17:30:59 -0500 [thread overview]
Message-ID: <20180118223058.GE25893@kudzu.us> (raw)
In-Reply-To: <20180116135116.4065102-1-arnd@arndb.de>
On Tue, Jan 16, 2018 at 02:50:51PM +0100, Arnd Bergmann wrote:
> 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 <logang@deltatee.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ----
> Originally sent on Dec 9, but this patch never got picked up
Sorry for missing the patch. Applied to ntb-next.
Thanks,
Jon
> ---
> 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
>
prev parent reply other threads:[~2018-01-18 22:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-16 13:50 [PATCH] [RESEND] ntb_hw_switchtec: fix logic error Arnd Bergmann
2018-01-18 22:30 ` Jon Mason [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180118223058.GE25893@kudzu.us \
--to=jdmason@kudzu.us \
--cc=Allen.Hubbe@emc.com \
--cc=arnd@arndb.de \
--cc=dave.jiang@intel.com \
--cc=kurt.schwemmer@microsemi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntb@googlegroups.com \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=sbates@raithlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).