aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-05-07 19:18:30 -0400
committerIan Moffett <ian@osmora.org>2024-05-07 19:18:30 -0400
commit9997280d8015124bd29375001c8f15d9cab0d023 (patch)
treecf1ba7649cd4e5e7d8efcbc929dda0a7d6502bad
parent139d593640cf8e7cc666818a29a689d5def541ef (diff)
kernel: nvme: Use PCI_BAR_MEMBASE() to fetch base
Use PCI_BAR_MEMBASE() instead of manually masking off bits to ensure the cleanness of the driver. Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/dev/ic/nvme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c
index 73533da..142003c 100644
--- a/sys/dev/ic/nvme.c
+++ b/sys/dev/ic/nvme.c
@@ -590,7 +590,7 @@ nvme_init(void)
return -1;
}
- bar = (struct nvme_bar *)(nvme_dev->bar[0] & ~7);
+ bar = PCI_BAR_MEMBASE(nvme_dev->bar[0]);
KINFO("NVMe BAR0 @ 0x%p\n", bar);
TAILQ_INIT(&namespaces);