From 6665722214804000d0052fd47fe5ac5ed6f5180b Mon Sep 17 00:00:00 2001 From: Kamil Godzwon Date: Wed, 4 Jan 2023 07:54:51 -0500 Subject: [PATCH] lib/vmd: fix build with clang 15 Used (void) on cmd and removed increment to fix clang 15 werror. vmd.c:368:11: error: variable 'cmd' set but not used [-Werror,-Wunused-but-set-variable] uint16_t cmd = dev->header->zero.command; ^ 1 error generated. Signed-off-by: Kamil Godzwon Change-Id: I4e383ac41b46d13df0210bf90f11f6130290f243 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16127 Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Paul Luse Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot --- lib/vmd/vmd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/vmd/vmd.c b/lib/vmd/vmd.c index 6590d8f2d..15b94e634 100644 --- a/lib/vmd/vmd.c +++ b/lib/vmd/vmd.c @@ -365,8 +365,11 @@ vmd_assign_base_addrs(struct vmd_pci_device *dev) /* Enable device MEM and bus mastering */ dev->header->zero.command |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); - uint16_t cmd = dev->header->zero.command; - cmd++; + /* + * Writes to the pci config space is posted write. To ensure transaction reaches its destination + * before another write is posed, an immediate read of the written value should be performed. + */ + { uint16_t cmd = dev->header->zero.command; (void)cmd; } if (dev->msix_cap && ret_val) { table_offset = ((volatile struct pci_msix_cap *)dev->msix_cap)->msix_table_offset;