nvme: don't always build constants.o
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Jul 2022 05:07:26 +0000 (07:07 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:22:48 +0000 (17:22 -0600)
The entire content of constants.c if guarded by an ifdef, so switch to
just building the file conditionally instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/Makefile
drivers/nvme/host/constants.c

index a3e88f3..e27202d 100644 (file)
@@ -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
index 4910543..6973c2a 100644 (file)
@@ -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 */