diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-03-25 10:17:26 +0100 |
---|---|---|
committer | Jon Mason <jdmason@kudzu.us> | 2019-06-13 14:59:14 +0200 |
commit | ff148d8ac53e59802645bd3200c811620317eb9f (patch) | |
tree | ed23ec9c9076c771e4c48437223972cd46ff9b89 | |
parent | NTB: ntb_transport: Ensure qp->tx_mw_dma_addr is initaliazed (diff) | |
download | linux-ff148d8ac53e59802645bd3200c811620317eb9f.tar.xz linux-ff148d8ac53e59802645bd3200c811620317eb9f.zip |
ntb_hw_switchtec: potential shift wrapping bug in switchtec_ntb_init_sndev()
This code triggers a Smatch warning:
drivers/ntb/hw/mscc/ntb_hw_switchtec.c:884 switchtec_ntb_init_sndev()
warn: should '(1 << sndev->peer_partition)' be a 64 bit type?
The "part_map" and "tpart_vec" variables are u64 type so this seems like
a valid warning.
Fixes: 3df54c870f52 ("ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
-rw-r--r-- | drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c index d905d368d28c..26a88731b0cb 100644 --- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c +++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c @@ -881,7 +881,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 & (1ULL << sndev->peer_partition))) { dev_err(&sndev->stdev->dev, "ntb target partition is not NT partition\n"); return -ENODEV; |