]> www.infradead.org Git - qemu-nvme.git/commit
hw/block/nvme: report actual LBA data shift in LBAF
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Mon, 28 Sep 2020 02:35:15 +0000 (11:35 +0900)
committerKeith Busch <kbusch@kernel.org>
Wed, 30 Sep 2020 21:28:27 +0000 (14:28 -0700)
commitb95245e8866fbc3b3816b7a797f1092c2147aa01
tree0c46e91dfc37e7cbbd0be865862f2c8cb4d03582
parentfa68168a9600f2127d53ba883bc48c05802db587
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>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
hw/block/nvme-ns.c