We may or may not be able to see the following output in nvme-loop env.
# nvme get-property /dev/nvme0 -o 0x14
property: 0x14 (Controller Configuration), value:
7f7800460001
The register CC is not in 64bit, but the upper bits are showing some values
even it's reserved in spec.
This patch makes this print size to fit to its own size of register.
Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
uint32_t value32;
if (!human) {
- printf("property: 0x%02x (%s), value: %"PRIx64"\n", offset,
- nvme_register_to_string(offset), value64);
+ if (is_64bit_reg(offset))
+ printf("property: 0x%02x (%s), value: %"PRIx64"\n", offset,
+ nvme_register_to_string(offset), value64);
+ else
+ printf("property: 0x%02x (%s), value: %x\n", offset,
+ nvme_register_to_string(offset),
+ (uint32_t) value64);
+
return;
}