hw/pci-bridge: Fix brace Werror with clang 6.0.0
PATCH 1/1 hw/pci-bridge: Fix brace Werror with clang 6.0.0
Two warnings are:
/hw/pci-bridge/cxl_downstream.c:101:51: error: suggest braces
around initialization of subobject [-Werror,-Wmissing-braces]
dvsec = (uint8_t *)&(CXLDVSECPortExtensions){ 0 };
^
{}/hw/pci-bridge/cxl_root_port.c:62:51: error: suggest braces
around initialization of subobject [-Werror,-Wmissing-braces]
dvsec = (uint8_t *)&(CXLDVSECPortExtensions){ 0 };
^
{}The original code is correct, just to work around clang's bogus warning.
Signed-off-by Chenyi Qiang <[email protected]>
--- hw/pci-bridge/cxl_downstream.c | 2 +- hw/pci-bridge/cxl_root_port.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/pci-bridge/cxl_downstream.c +1 -1
@@ -98,7 +98,7 @@ static void build_dvsecs(CXLComponentState *cxl) {uint8_t *dvsec; - dvsec = (uint8_t *)&(CXLDVSECPortExtensions ){0 }; + dvsec = (uint8_t *)&(CXLDVSECPortExtensions ){ }; cxl_component_create_dvsec(cxl, CXL2_DOWNSTREAM_PORT, EXTENSIONS_PORT_DVSEC_LENGTH, EXTENSIONS_PORT_DVSEC,
hw/pci-bridge/cxl_root_port.c +1 -1
@@ -59,7 +59,7 @@ static void build_dvsecs(CXLComponentState *cxl) {uint8_t *dvsec; - dvsec = (uint8_t *)&(CXLDVSECPortExtensions ){0 }; + dvsec = (uint8_t *)&(CXLDVSECPortExtensions ){ }; cxl_component_create_dvsec(cxl, CXL2_ROOT_PORT, EXTENSIONS_PORT_DVSEC_LENGTH, EXTENSIONS_PORT_DVSEC,
Signature · 1 line
2.17.1