From 9997280d8015124bd29375001c8f15d9cab0d023 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 7 May 2024 19:18:30 -0400 Subject: 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 --- sys/dev/ic/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys') 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); -- cgit v1.2.3