Skip to content

Commit 2af3218

Browse files
ikegami-tigaw
authored andcommitted
nvme-print-stdout: Use NVME_PMRMSC register definitions to print
Change it instead of hardcoded register mask and shift values. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
1 parent 0a7600f commit 2af3218

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nvme-print-stdout.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -1411,9 +1411,8 @@ static void stdout_registers_pmrswtp(__u32 pmrswtp)
14111411
static void stdout_registers_pmrmscl(uint32_t pmrmscl)
14121412
{
14131413
printf("\tController Base Address (CBA): %#x\n",
1414-
(pmrmscl & 0xfffff000) >> 12);
1415-
printf("\tController Memory Space Enable (CMSE): %#x\n\n",
1416-
(pmrmscl & 0x00000002) >> 1);
1414+
(uint32_t)NVME_PMRMSC_CBA(pmrmscl));
1415+
printf("\tController Memory Space Enable (CMSE): %#x\n\n", NVME_PMRMSC_CMSE(pmrmscl));
14171416
}
14181417

14191418
static void stdout_registers_pmrmscu(uint32_t pmrmscu)

0 commit comments

Comments
 (0)