hw/block/nvme: report actual LBA data shift in LBAF
commitb865cabf735be793789ad2c7eac97f47a1325966
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Mon, 28 Sep 2020 02:35:15 +0000 (28 11:35 +0900)
committerKlaus Jensen <k.jensen@samsung.com>
Tue, 27 Oct 2020 10:29:25 +0000 (27 11:29 +0100)
tree84ac848c732d0a339cb3f46a86b82443f32dfff8
parentdcd1496132704ca16fc857a40370a6b9209341ae
hw/block/nvme: report actual LBA data shift in LBAF

Calculate the data shift value to report based on the set value of
logical_block_size device property.

In the process, use a local variable to calculate the LBA format
index instead of the hardcoded value 0. This makes the code more
readable and it will make it easier to add support for multiple LBA
formats in the future.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
hw/block/nvme-ns.c