Skip to content

Commit 43e2d08

Browse files
Max GurtovoyChristoph Hellwig
authored andcommitted
nvme: avoid double dereference to convert le to cpu
Use le16_to_cpu instead of le16_to_cpup and le64_to_cpu instead of le64_to_cpup. This will also align the code to nvme-core driver convention. Signed-off-by: Max Gurtovoy <maxg@mellanox.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 2b24e6f commit 43e2d08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvme/host/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ static bool nvme_ns_ids_equal(struct nvme_ns_ids *a, struct nvme_ns_ids *b)
15881588
static void nvme_update_disk_info(struct gendisk *disk,
15891589
struct nvme_ns *ns, struct nvme_id_ns *id)
15901590
{
1591-
sector_t capacity = le64_to_cpup(&id->nsze) << (ns->lba_shift - 9);
1591+
sector_t capacity = le64_to_cpu(id->nsze) << (ns->lba_shift - 9);
15921592
unsigned short bs = 1 << ns->lba_shift;
15931593

15941594
blk_mq_freeze_queue(disk->queue);
@@ -2549,7 +2549,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
25492549
ctrl->crdt[2] = le16_to_cpu(id->crdt3);
25502550

25512551
ctrl->oacs = le16_to_cpu(id->oacs);
2552-
ctrl->oncs = le16_to_cpup(&id->oncs);
2552+
ctrl->oncs = le16_to_cpu(id->oncs);
25532553
ctrl->oaes = le32_to_cpu(id->oaes);
25542554
atomic_set(&ctrl->abort_limit, id->acl + 1);
25552555
ctrl->vwc = id->vwc;

0 commit comments

Comments
 (0)