Skip to contentSkip to conversation

nvme: don't always build constants.o

PATCH In review Christoph Hellwig 4 participants 4 messages Jul 18, 2022 – Jul 21, 2022 NVMe

lore
Share & tools
lore

Christoph Hellwig

author maintainer
#0 lore raw

PATCH 1/1 nvme: don't always build constants.o

The entire content of constants.c if guarded by an ifdef, so switch to just building the file conditionally instead.

---
 drivers/nvme/host/Makefile    | 3 ++-
 drivers/nvme/host/constants.c | 2 --
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/nvme/host/Makefile +2 -1
index a3e88f32f560b..e27202d22c7d9 100644
@@ -10,7 +10,8 @@ obj-$(CONFIG_NVME_FC)			+= nvme-fc.o
 obj-$(CONFIG_NVME_TCP)			+= nvme-tcp.o
 obj-$(CONFIG_NVME_APPLE)		+= nvme-apple.o
 
-nvme-core-y				:= core.o ioctl.o constants.o
+nvme-core-y				+= core.o ioctl.o
+nvme-core-$(CONFIG_NVME_VERBOSE_ERRORS)	+= constants.o
 nvme-core-$(CONFIG_TRACING)		+= trace.o
 nvme-core-$(CONFIG_NVME_MULTIPATH)	+= multipath.o
 nvme-core-$(CONFIG_BLK_DEV_ZONED)	+= zns.o
drivers/nvme/host/constants.c +0 -2
index 4910543f00ff9..6973c2a17c13d 100644
@@ -6,7 +6,6 @@
 
 #include "nvme.h"
 
-#ifdef CONFIG_NVME_VERBOSE_ERRORS
 static const char * const nvme_ops[] = {
 	[nvme_cmd_flush] = "Flush",
 	[nvme_cmd_write] = "Write",
@@ -185,4 +184,3 @@ const unsigned char *nvme_get_admin_opcode_str(u8 opcode)
 		return nvme_admin_ops[opcode];
 	return "Unknown";
 }
-#endif /* CONFIG_NVME_VERBOSE_ERRORS */
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Christoph Hellwig

The entire content of constants.c if guarded by an ifdef, so switch to just building the file conditionally instead.

Looks good.