Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
eb7e2d92 679c54f2

+2 -3
+2 -1
drivers/nvme/host/Makefile
··· 10 10 obj-$(CONFIG_NVME_TCP) += nvme-tcp.o 11 11 obj-$(CONFIG_NVME_APPLE) += nvme-apple.o 12 12 13 - nvme-core-y := core.o ioctl.o constants.o 13 + nvme-core-y += core.o ioctl.o 14 + nvme-core-$(CONFIG_NVME_VERBOSE_ERRORS) += constants.o 14 15 nvme-core-$(CONFIG_TRACING) += trace.o 15 16 nvme-core-$(CONFIG_NVME_MULTIPATH) += multipath.o 16 17 nvme-core-$(CONFIG_BLK_DEV_ZONED) += zns.o
-2
drivers/nvme/host/constants.c
··· 6 6 7 7 #include "nvme.h" 8 8 9 - #ifdef CONFIG_NVME_VERBOSE_ERRORS 10 9 static const char * const nvme_ops[] = { 11 10 [nvme_cmd_flush] = "Flush", 12 11 [nvme_cmd_write] = "Write", ··· 184 185 return nvme_admin_ops[opcode]; 185 186 return "Unknown"; 186 187 } 187 - #endif /* CONFIG_NVME_VERBOSE_ERRORS */