git: 64b805d52eec - main - nvme: Move default is_storage method to nvme_private.h
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 20 Jun 2026 17:48:03 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=64b805d52eec795c6436def24cec508404b5bfdc
commit 64b805d52eec795c6436def24cec508404b5bfdc
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2026-06-20 17:44:27 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-06-20 17:46:37 +0000
nvme: Move default is_storage method to nvme_private.h
Since CODE entries wind up in the nvme_if.c file, we got warnings when
it wasn't used (which is always). Move it into nvme_private and change
its name to nvme_is_storage_default to put it into the nvme_ namespace.
Fixes: 949804c81909
Sponsored by: Netflix
---
sys/dev/nvme/nvme_if.m | 10 +---------
sys/dev/nvme/nvme_private.h | 6 ++++++
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/sys/dev/nvme/nvme_if.m b/sys/dev/nvme/nvme_if.m
index 9705aeb7ce0b..4484c1da9dce 100644
--- a/sys/dev/nvme/nvme_if.m
+++ b/sys/dev/nvme/nvme_if.m
@@ -12,14 +12,6 @@ HEADER {
#include "dev/nvme/nvme_private.h"
};
-CODE {
- static bool
- default_is_storage_device(device_t dev)
- {
- return (true);
- }
-}
-
#
# A new namespace is now available
#
@@ -67,4 +59,4 @@ METHOD int handle_aen {
#
METHOD bool is_storage_device {
device_t dev;
-} default default_is_storage_device;
+} default nvme_is_storage_device_default;
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
index f5918a04be72..ec941f31779c 100644
--- a/sys/dev/nvme/nvme_private.h
+++ b/sys/dev/nvme/nvme_private.h
@@ -591,4 +591,10 @@ void nvme_ctrlr_poll(struct nvme_controller *ctrlr);
int nvme_ctrlr_suspend(struct nvme_controller *ctrlr);
int nvme_ctrlr_resume(struct nvme_controller *ctrlr);
+static inline bool
+nvme_is_storage_device_default(device_t dev)
+{
+ return (true);
+}
+
#endif /* __NVME_PRIVATE_H__ */