From a6cf458c9d508fd47262d02f4dd596c7b2ff4ab3 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 22 Sep 2015 12:37:21 -0700 Subject: [PATCH] nvme: tweak unit test PCI config space accessors Make nvme_pcicfg_read32 set the referenced variable and make nvme_pcicfg_write32 appear to read it so that the compiler doesn't warn about unused/uninitialized data. Change-Id: I4f06c0cca2fc11a8c6c5a60543c1c50a2f6a412d Signed-off-by: Daniel Verkamp --- test/lib/nvme/unit/nvme_impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lib/nvme/unit/nvme_impl.h b/test/lib/nvme/unit/nvme_impl.h index 7512e11459..9b9ff4714c 100644 --- a/test/lib/nvme/unit/nvme_impl.h +++ b/test/lib/nvme/unit/nvme_impl.h @@ -61,8 +61,8 @@ do \ while (0); #define nvme_free_request(buf) free(buf) -#define nvme_pcicfg_read32(handle, var, offset) -#define nvme_pcicfg_write32(handle, var, offset) +#define nvme_pcicfg_read32(handle, var, offset) do { *(var) = 0xFFFFFFFFu; } while (0) +#define nvme_pcicfg_write32(handle, var, offset) do { (void)(var); } while (0) static inline int nvme_pcicfg_map_bar(void *pci_handle, int bar, int read_only, void **addr)