diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2019-05-15 08:37:56 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2019-05-19 16:17:33 +0800 |
commit | 5b2a20e9564c46a571126275991426dd8618e2d8 (patch) | |
tree | b57b7f5d4367080e5c3d3ad5e1cace34089ee534 /drivers/nvme/nvme.c | |
parent | b52e9f0cb748d2a2ae26db62072294b9cccdb86f (diff) | |
download | u-boot-5b2a20e9564c46a571126275991426dd8618e2d8.zip u-boot-5b2a20e9564c46a571126275991426dd8618e2d8.tar.gz u-boot-5b2a20e9564c46a571126275991426dd8618e2d8.tar.bz2 |
nvme: Fix warning of cast from pointer to integer of different size
When dma_addr_t is u32 in 64-bit, there are some warnings when
building NVME driver. Fix it by doing an additional (long) cast.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/nvme/nvme.c')
-rw-r--r-- | drivers/nvme/nvme.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c index 1ee0a0a..d4965e2 100644 --- a/drivers/nvme/nvme.c +++ b/drivers/nvme/nvme.c @@ -577,7 +577,7 @@ static int nvme_get_info_from_identify(struct nvme_dev *dev) int ret; int shift = NVME_CAP_MPSMIN(dev->cap) + 12; - ret = nvme_identify(dev, 0, 1, (dma_addr_t)ctrl); + ret = nvme_identify(dev, 0, 1, (dma_addr_t)(long)ctrl); if (ret) return -EIO; @@ -646,7 +646,7 @@ static int nvme_blk_probe(struct udevice *udev) ns->dev = ndev; /* extract the namespace id from the block device name */ ns->ns_id = trailing_strtol(udev->name) + 1; - if (nvme_identify(ndev, ns->ns_id, 0, (dma_addr_t)id)) + if (nvme_identify(ndev, ns->ns_id, 0, (dma_addr_t)(long)id)) return -EIO; flbas = id->flbas & NVME_NS_FLBAS_LBA_MASK; |