Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/55910 )
Change subject: SMBIOS: Drop now-unnecessary unions ......................................................................
SMBIOS: Drop now-unnecessary unions
Now that the refactoring is complete, the unions for the table header are no longer needed. Therefore, drop them.
Change-Id: I4e170e84a12646386d3fd84ae973dd6c18f25809 Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/55910 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/drivers/wifi/generic/smbios.c M src/include/smbios.h 2 files changed, 18 insertions(+), 144 deletions(-)
Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/drivers/wifi/generic/smbios.c b/src/drivers/wifi/generic/smbios.c index 7c697ad..793349d 100644 --- a/src/drivers/wifi/generic/smbios.c +++ b/src/drivers/wifi/generic/smbios.c @@ -10,14 +10,7 @@ static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned long *current) { struct smbios_type_intel_wifi { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 str; u8 eos[2]; } __packed; diff --git a/src/include/smbios.h b/src/include/smbios.h index edc56f7..a98023b 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -287,14 +287,7 @@ } __packed;
struct smbios_type0 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 vendor; u8 bios_version; u16 bios_start_segment; @@ -312,14 +305,7 @@ } __packed;
struct smbios_type1 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 manufacturer; u8 product_name; u8 version; @@ -354,14 +340,7 @@ } smbios_board_type;
struct smbios_type2 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 manufacturer; u8 product_name; u8 version; @@ -414,14 +393,7 @@ } smbios_enclosure_type;
struct smbios_type3 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 manufacturer; u8 _type; u8 version; @@ -441,14 +413,7 @@ } __packed;
struct smbios_type4 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 socket_designation; u8 processor_type; u8 processor_family; @@ -559,14 +524,7 @@ #define SMBIOS_CACHE_OP_MODE_UNKNOWN 3
struct smbios_type7 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 socket_designation; u16 cache_configuration; u16 max_cache_size; @@ -680,14 +638,7 @@ };
struct smbios_type8 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 internal_reference_designator; u8 internal_connector_type; u8 external_reference_designator; @@ -822,14 +773,7 @@ } __packed;
struct smbios_type9 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 slot_designation; u8 slot_type; u8 slot_data_bus_width; @@ -848,27 +792,13 @@ } __packed;
struct smbios_type11 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 count; u8 eos[2]; } __packed;
struct smbios_type15 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u16 area_length; u16 header_offset; u16 data_offset; @@ -898,14 +828,7 @@ #define SMBIOS_USE_EXTENDED_MAX_CAPACITY (1 << 31)
struct smbios_type16 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 location; u8 use; u8 memory_error_correction; @@ -917,14 +840,7 @@ } __packed;
struct smbios_type17 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u16 phys_memory_array_handle; u16 memory_error_information_handle; u16 total_width; @@ -951,14 +867,7 @@ } __packed;
struct smbios_type19 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u32 starting_address; u32 ending_address; u16 memory_array_handle; @@ -969,28 +878,14 @@ } __packed;
struct smbios_type32 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 reserved[6]; u8 boot_status; u8 eos[2]; } __packed;
struct smbios_type38 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 interface_type; u8 ipmi_rev; u8 i2c_slave_addr; @@ -1025,14 +920,7 @@ #define SMBIOS_DEVICE_TYPE_COUNT 10
struct smbios_type41 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 reference_designation; u8 device_type: 7; u8 device_status: 1; @@ -1045,14 +933,7 @@ } __packed;
struct smbios_type127 { - union { - struct { - u8 type; - u8 length; - u16 handle; - }; - struct smbios_header header; - }; + struct smbios_header header; u8 eos[2]; } __packed;