git: 775e421dc38f - main - nvme: Fix default is_storage_device kobj method

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Thu, 22 Oct 2026 16:41:29 UTC
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=775e421dc38f18fa6b7fdc7b214a013cca44b58b

commit 775e421dc38f18fa6b7fdc7b214a013cca44b58b
Author:     Ayrton Munoz <a.munoz3327@gmail.com>
AuthorDate: 2026-10-22 16:40:50 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-10-22 16:40:50 +0000

    nvme: Fix default is_storage_device kobj method
    
    makeobjops.awk only accepts an uppercase DEFAULT before a default kobj
    method. This commit fixes a typo introduced in 949804c81909 so non-PCI
    drivers actually use nvme_is_storage_device_default instead of
    kobj_error_method. Note that even though kobj_error_method returns
    ENXIO (6), it does not get implicitly cast to a bool due to the function
    pointer casting in the nvme_if.h generated by makeobjops. Instead the
    codegen for the NVME_IS_STORAGE_DEVICE callsite shows that only the
    lowest bit is being checked as if it were always a bool. Without this
    any nvme driver that doesn't implement is_storage_device is not treated
    as a storage device.
    
    Reviewed by:    imp, kevans
    Differential Revision:  https://reviews.freebsd.org/D60112
---
 sys/dev/nvme/nvme_if.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/nvme/nvme_if.m b/sys/dev/nvme/nvme_if.m
index 4484c1da9dce..e0186914f3cc 100644
--- a/sys/dev/nvme/nvme_if.m
+++ b/sys/dev/nvme/nvme_if.m
@@ -59,4 +59,4 @@ METHOD int handle_aen {
 #
 METHOD bool is_storage_device {
         device_t dev;
-} default nvme_is_storage_device_default;
+} DEFAULT nvme_is_storage_device_default;