diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-08-18 11:57:43 +0300 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-08-27 04:07:37 +0300 |
commit | 4da74db0d9a6ffe053d3a3efa756906e0afc4cf7 (patch) | |
tree | 5d945f02723b8c8616d1c7a5f6a6ae0ab0fdddd1 /drivers/scsi | |
parent | 46c6d45d7875a0328258a574e376ae75f7b2a64b (diff) | |
download | linux-4da74db0d9a6ffe053d3a3efa756906e0afc4cf7.tar.xz |
cxlflash: shift wrapping bug in afu_link_reset()
"port_sel" is a u64 so the shifting should also be a 64 bit shift.
Fixes: c21e0bbfc485 ('cxlflash: Base support for IBM CXL Flash Adapter')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/cxlflash/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index fde2ba9342dc..caa1d09dafec 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -1248,7 +1248,7 @@ static void afu_link_reset(struct afu *afu, int port, u64 *fc_regs) /* first switch the AFU to the other links, if any */ port_sel = readq_be(&afu->afu_map->global.regs.afu_port_sel); - port_sel &= ~(1 << port); + port_sel &= ~(1ULL << port); writeq_be(port_sel, &afu->afu_map->global.regs.afu_port_sel); cxlflash_afu_sync(afu, 0, 0, AFU_GSYNC); @@ -1265,7 +1265,7 @@ static void afu_link_reset(struct afu *afu, int port, u64 *fc_regs) __func__, port); /* switch back to include this port */ - port_sel |= (1 << port); + port_sel |= (1ULL << port); writeq_be(port_sel, &afu->afu_map->global.regs.afu_port_sel); cxlflash_afu_sync(afu, 0, 0, AFU_GSYNC); |