Utkarsh Verma has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74170 )
Change subject: arch/x86/smbios: Fix file formatting ......................................................................
arch/x86/smbios: Fix file formatting
Change-Id: I40f44eec4d14d8b905f438c5305b640a33408c45 Signed-off-by: Utkarsh Verma utkarsh@bitbanged.com --- M src/arch/x86/smbios.c M src/arch/x86/smbios_defaults.c 2 files changed, 140 insertions(+), 163 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/74170/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 188fb42..35c6693 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -20,12 +20,11 @@ #include <drivers/vpd/vpd.h> #include <stdlib.h>
-#define update_max(len, max_len, stmt) \ - do { \ - int tmp = stmt; \ - \ - max_len = MAX(max_len, tmp); \ - len += tmp; \ +#define update_max(len, max_len, stmt) \ + do { \ + int tmp = stmt; \ + max_len = MAX(max_len, tmp); \ + len += tmp; \ } while (0)
static u8 smbios_checksum(u8 *p, u32 length) @@ -60,7 +59,7 @@ if (!strcmp(p, str)) return i;
- p += strlen(p)+1; + p += strlen(p) + 1; i++; } } @@ -213,21 +212,20 @@ { char serial[9];
- snprintf(serial, sizeof(serial), "%02hhx%02hhx%02hhx%02hhx", - dimm->serial[0], dimm->serial[1], dimm->serial[2], dimm->serial[3]); + snprintf(serial, sizeof(serial), "%02hhx%02hhx%02hhx%02hhx", dimm->serial[0], + dimm->serial[1], dimm->serial[2], dimm->serial[3]);
t->serial_number = smbios_add_string(t->eos, serial); }
-static int create_smbios_type17_for_dimm(struct dimm_info *dimm, - unsigned long *current, int *handle, - int type16_handle) +static int create_smbios_type17_for_dimm(struct dimm_info *dimm, unsigned long *current, + int *handle, int type16_handle) { struct spd_info info; get_spd_info(dimm->ddr_type, dimm->mod_type, &info);
- struct smbios_type17 *t = smbios_carve_table(*current, SMBIOS_MEMORY_DEVICE, - sizeof(*t), *handle); + struct smbios_type17 *t = + smbios_carve_table(*current, SMBIOS_MEMORY_DEVICE, sizeof(*t), *handle);
t->memory_type = dimm->ddr_type; if (dimm->configured_speed_mts != 0) @@ -276,21 +274,20 @@ return smbios_full_table_len(&t->header, t->eos); }
-static int create_smbios_type17_for_empty_slot(struct dimm_info *dimm, - unsigned long *current, int *handle, - int type16_handle) +static int create_smbios_type17_for_empty_slot(struct dimm_info *dimm, unsigned long *current, + int *handle, int type16_handle) { - struct smbios_type17 *t = smbios_carve_table(*current, SMBIOS_MEMORY_DEVICE, - sizeof(*t), *handle); + struct smbios_type17 *t = + smbios_carve_table(*current, SMBIOS_MEMORY_DEVICE, sizeof(*t), *handle); t->phys_memory_array_handle = type16_handle; /* no handle for error information */ t->memory_error_information_handle = 0xfffe; - t->total_width = 0xffff; /* Unknown */ - t->data_width = 0xffff; /* Unknown */ - t->form_factor = 0x2; /* Unknown */ + t->total_width = 0xffff; /* Unknown */ + t->data_width = 0xffff; /* Unknown */ + t->form_factor = 0x2; /* Unknown */ smbios_fill_dimm_locator(dimm, t); /* Device and Bank */ - t->memory_type = 0x2; /* Unknown */ - t->type_detail = 0x2; /* Unknown */ + t->memory_type = 0x2; /* Unknown */ + t->type_detail = 0x2; /* Unknown */
*handle += 1; return smbios_full_table_len(&t->header, t->eos); @@ -324,8 +321,7 @@ { const char *s;
-#define SPACES \ - " " +#define SPACES " "
if (CONFIG(CHROMEOS)) return SPACES; @@ -342,19 +338,19 @@
if (strlen(CONFIG_LOCALVERSION) != 0) { printk(BIOS_DEBUG, "BIOS version set to CONFIG_LOCALVERSION: '%s'\n", - CONFIG_LOCALVERSION); + CONFIG_LOCALVERSION); return CONFIG_LOCALVERSION; }
printk(BIOS_DEBUG, "SMBIOS firmware version is set to coreboot_version: '%s'\n", - coreboot_version); + coreboot_version); return coreboot_version; }
static int smbios_write_type0(unsigned long *current, int handle) { - struct smbios_type0 *t = smbios_carve_table(*current, SMBIOS_BIOS_INFORMATION, - sizeof(*t), handle); + struct smbios_type0 *t = + smbios_carve_table(*current, SMBIOS_BIOS_INFORMATION, sizeof(*t), handle);
t->vendor = smbios_add_string(t->eos, "coreboot"); t->bios_release_date = smbios_add_string(t->eos, coreboot_dmi_date); @@ -380,10 +376,9 @@
smbios_ec_revision(&t->ec_major_release, &t->ec_minor_release);
- t->bios_characteristics = - BIOS_CHARACTERISTICS_PCI_SUPPORTED | - BIOS_CHARACTERISTICS_SELECTABLE_BOOT | - BIOS_CHARACTERISTICS_UPGRADEABLE; + t->bios_characteristics = BIOS_CHARACTERISTICS_PCI_SUPPORTED + | BIOS_CHARACTERISTICS_SELECTABLE_BOOT + | BIOS_CHARACTERISTICS_UPGRADEABLE;
if (CONFIG(CARDBUS_PLUGIN_SUPPORT)) t->bios_characteristics |= BIOS_CHARACTERISTICS_PC_CARD; @@ -441,7 +436,7 @@
unsigned int __weak smbios_cache_sram_type(void) { - return SMBIOS_CACHE_SRAM_TYPE_UNKNOWN; + return SMBIOS_CACHE_SRAM_TYPE_UNKNOWN; }
unsigned int __weak smbios_cache_conf_operation_mode(u8 level) @@ -484,8 +479,8 @@
static int smbios_write_type1(unsigned long *current, int handle) { - struct smbios_type1 *t = smbios_carve_table(*current, SMBIOS_SYSTEM_INFORMATION, - sizeof(*t), handle); + struct smbios_type1 *t = + smbios_carve_table(*current, SMBIOS_SYSTEM_INFORMATION, sizeof(*t), handle);
t->manufacturer = smbios_add_string(t->eos, smbios_system_manufacturer()); t->product_name = smbios_add_string(t->eos, smbios_system_product_name()); @@ -504,8 +499,8 @@
static int smbios_write_type2(unsigned long *current, int handle, const int chassis_handle) { - struct smbios_type2 *t = smbios_carve_table(*current, SMBIOS_BOARD_INFORMATION, - sizeof(*t), handle); + struct smbios_type2 *t = + smbios_carve_table(*current, SMBIOS_BOARD_INFORMATION, sizeof(*t), handle);
t->manufacturer = smbios_add_string(t->eos, smbios_mainboard_manufacturer()); t->product_name = smbios_add_string(t->eos, smbios_mainboard_product_name()); @@ -513,8 +508,8 @@ t->version = smbios_add_string(t->eos, smbios_mainboard_version()); t->asset_tag = smbios_add_string(t->eos, smbios_mainboard_asset_tag()); t->feature_flags = smbios_mainboard_feature_flags(); - t->location_in_chassis = smbios_add_string(t->eos, - smbios_mainboard_location_in_chassis()); + t->location_in_chassis = + smbios_add_string(t->eos, smbios_mainboard_location_in_chassis()); t->board_type = smbios_mainboard_board_type(); t->chassis_handle = chassis_handle; const int len = smbios_full_table_len(&t->header, t->eos); @@ -524,8 +519,8 @@
static int smbios_write_type3(unsigned long *current, int handle) { - struct smbios_type3 *t = smbios_carve_table(*current, SMBIOS_SYSTEM_ENCLOSURE, - sizeof(*t), handle); + struct smbios_type3 *t = + smbios_carve_table(*current, SMBIOS_SYSTEM_ENCLOSURE, sizeof(*t), handle);
t->manufacturer = smbios_add_string(t->eos, smbios_system_manufacturer()); t->bootup_state = SMBIOS_STATE_SAFE; @@ -559,8 +554,8 @@ if (cpu_have_cpuid()) res = cpuid(1);
- struct smbios_type4 *t = smbios_carve_table(*current, SMBIOS_PROCESSOR_INFORMATION, - sizeof(*t), handle); + struct smbios_type4 *t = + smbios_carve_table(*current, SMBIOS_PROCESSOR_INFORMATION, sizeof(*t), handle);
snprintf(buf, sizeof(buf), "CPU%d", cnt++); t->socket_designation = smbios_add_string(t->eos, buf); @@ -648,26 +643,23 @@ * Fill in some fields with constant values, as gathering the information * from CPUID is impossible. */ -static int smbios_write_type7(unsigned long *current, - const int handle, - const u8 level, +static int smbios_write_type7(unsigned long *current, const int handle, const u8 level, const u8 sram_type, const enum smbios_cache_associativity associativity, - const enum smbios_cache_type type, - const size_t max_cache_size, + const enum smbios_cache_type type, const size_t max_cache_size, const size_t cache_size) { char buf[8];
- struct smbios_type7 *t = smbios_carve_table(*current, SMBIOS_CACHE_INFORMATION, - sizeof(*t), handle); + struct smbios_type7 *t = + smbios_carve_table(*current, SMBIOS_CACHE_INFORMATION, sizeof(*t), handle);
snprintf(buf, sizeof(buf), "CACHE%x", level); t->socket_designation = smbios_add_string(t->eos, buf);
- t->cache_configuration = SMBIOS_CACHE_CONF_LEVEL(level) | - SMBIOS_CACHE_CONF_LOCATION(0) | /* Internal */ - SMBIOS_CACHE_CONF_ENABLED(1) | /* Enabled */ + t->cache_configuration = + SMBIOS_CACHE_CONF_LEVEL(level) | SMBIOS_CACHE_CONF_LOCATION(0) | /* Internal */ + SMBIOS_CACHE_CONF_ENABLED(1) | /* Enabled */ SMBIOS_CACHE_CONF_OPERATION_MODE(smbios_cache_conf_operation_mode(level));
if (max_cache_size < (SMBIOS_CACHE_SIZE_MASK * KiB)) { @@ -758,10 +750,8 @@ * @param max_struct_size Pointer to maximum struct size * @param type4 Pointer to SMBIOS type 4 structure */ -static int smbios_write_type7_cache_parameters(unsigned long *current, - int *handle, - int *max_struct_size, - struct smbios_type4 *type4) +static int smbios_write_type7_cache_parameters(unsigned long *current, int *handle, + int *max_struct_size, struct smbios_type4 *type4) { unsigned int cnt = CACHE_L1D; int len = 0; @@ -771,8 +761,9 @@
enum cpu_type dcache_cpuid = cpu_check_deterministic_cache_cpuid_supported(); if (dcache_cpuid == CPUID_TYPE_INVALID || dcache_cpuid == CPUID_COMMAND_UNSUPPORTED) { - printk(BIOS_DEBUG, "SMBIOS: Unknown CPU or CPU doesn't support Deterministic " - "Cache CPUID leaf\n"); + printk(BIOS_DEBUG, + "SMBIOS: Unknown CPU or CPU doesn't support Deterministic " + "Cache CPUID leaf\n"); return len; }
@@ -815,9 +806,9 @@
const int h = (*handle)++;
- update_max(len, *max_struct_size, smbios_write_type7(current, h, - level, smbios_cache_sram_type(), associativity, - type, cache_size, cache_size)); + update_max(len, *max_struct_size, + smbios_write_type7(current, h, level, smbios_cache_sram_type(), + associativity, type, cache_size, cache_size));
if (type4) { switch (level) { @@ -837,16 +828,14 @@ return len; }
-int smbios_write_type8(unsigned long *current, int *handle, - const struct port_information *port, - size_t num_ports) +int smbios_write_type8(unsigned long *current, int *handle, const struct port_information *port, + size_t num_ports) { unsigned int totallen = 0, i;
for (i = 0; i < num_ports; i++, port++) { - struct smbios_type8 *t = smbios_carve_table(*current, - SMBIOS_PORT_CONNECTOR_INFORMATION, - sizeof(*t), *handle); + struct smbios_type8 *t = smbios_carve_table( + *current, SMBIOS_PORT_CONNECTOR_INFORMATION, sizeof(*t), *handle); t->internal_reference_designator = smbios_add_string(t->eos, port->internal_reference_designator); t->internal_connector_type = port->internal_connector_type; @@ -862,15 +851,14 @@ return totallen; }
-int smbios_write_type9(unsigned long *current, int *handle, - const char *name, const enum misc_slot_type type, - const enum slot_data_bus_bandwidth bandwidth, - const enum misc_slot_usage usage, - const enum misc_slot_length length, - const u16 id, u8 slot_char1, u8 slot_char2, u8 bus, u8 dev_func) +int smbios_write_type9(unsigned long *current, int *handle, const char *name, + const enum misc_slot_type type, + const enum slot_data_bus_bandwidth bandwidth, + const enum misc_slot_usage usage, const enum misc_slot_length length, + const u16 id, u8 slot_char1, u8 slot_char2, u8 bus, u8 dev_func) { - struct smbios_type9 *t = smbios_carve_table(*current, SMBIOS_SYSTEM_SLOTS, - sizeof(*t), *handle); + struct smbios_type9 *t = + smbios_carve_table(*current, SMBIOS_SYSTEM_SLOTS, sizeof(*t), *handle);
t->slot_designation = smbios_add_string(t->eos, name ? name : "SLOT"); t->slot_type = type; @@ -895,8 +883,8 @@ static int smbios_write_type11(unsigned long *current, int *handle) { struct device *dev; - struct smbios_type11 *t = smbios_carve_table(*current, SMBIOS_OEM_STRINGS, - sizeof(*t), *handle); + struct smbios_type11 *t = + smbios_carve_table(*current, SMBIOS_OEM_STRINGS, sizeof(*t), *handle);
for (dev = all_devices; dev; dev = dev->next) { if (dev->ops && dev->ops->get_smbios_strings) @@ -922,7 +910,7 @@ struct memory_info *meminfo; meminfo = cbmem_find(CBMEM_ID_MEMINFO); if (meminfo == NULL) - return 0; /* can't find mem info in cbmem */ + return 0; /* can't find mem info in cbmem */
printk(BIOS_INFO, "Create SMBIOS type 16\n");
@@ -936,8 +924,8 @@ } }
- struct smbios_type16 *t = smbios_carve_table(*current, SMBIOS_PHYS_MEMORY_ARRAY, - sizeof(*t), *handle); + struct smbios_type16 *t = + smbios_carve_table(*current, SMBIOS_PHYS_MEMORY_ARRAY, sizeof(*t), *handle);
t->location = MEMORY_ARRAY_LOCATION_SYSTEM_BOARD; t->use = MEMORY_ARRAY_USE_SYSTEM; @@ -968,7 +956,7 @@ struct memory_info *meminfo; meminfo = cbmem_find(CBMEM_ID_MEMINFO); if (meminfo == NULL) - return 0; /* can't find mem info in cbmem */ + return 0; /* can't find mem info in cbmem */
printk(BIOS_INFO, "Create SMBIOS type 17\n"); for (i = 0; i < meminfo->dimm_cnt && i < ARRAY_SIZE(meminfo->dimm); i++) { @@ -998,11 +986,10 @@ struct memory_info *meminfo; meminfo = cbmem_find(CBMEM_ID_MEMINFO); if (meminfo == NULL) - return 0; /* can't find mem info in cbmem */ + return 0; /* can't find mem info in cbmem */
- struct smbios_type19 *t = smbios_carve_table(*current, - SMBIOS_MEMORY_ARRAY_MAPPED_ADDRESS, - sizeof(*t), *handle); + struct smbios_type19 *t = smbios_carve_table( + *current, SMBIOS_MEMORY_ARRAY_MAPPED_ADDRESS, sizeof(*t), *handle);
t->memory_array_handle = type16;
@@ -1015,8 +1002,8 @@ t->extended_ending_address *= MiB;
/* Check if it fits into regular address */ - if (t->extended_ending_address >= KiB && - t->extended_ending_address < 0x40000000000ULL) { + if (t->extended_ending_address >= KiB + && t->extended_ending_address < 0x40000000000ULL) { /* * FIXME: The starting address is SoC specific, but SMBIOS tables are only * exported on x86 where it's always 0. @@ -1040,10 +1027,10 @@ }
static int smbios_write_type20_table(unsigned long *current, int *handle, u32 addr_start, - u32 addr_end, int type17_handle, int type19_handle) + u32 addr_end, int type17_handle, int type19_handle) { - struct smbios_type20 *t = smbios_carve_table(*current, SMBIOS_MEMORY_DEVICE_MAPPED_ADDRESS, - sizeof(*t), *handle); + struct smbios_type20 *t = smbios_carve_table( + *current, SMBIOS_MEMORY_DEVICE_MAPPED_ADDRESS, sizeof(*t), *handle);
t->memory_device_handle = type17_handle; t->memory_array_mapped_address_handle = type19_handle; @@ -1059,8 +1046,8 @@ return len; }
-static int smbios_write_type20(unsigned long *current, int *handle, - int type17_handle, int type19_handle) +static int smbios_write_type20(unsigned long *current, int *handle, int type17_handle, + int type19_handle) { u32 start_addr = 0; int totallen = 0; @@ -1069,7 +1056,7 @@ struct memory_info *meminfo; meminfo = cbmem_find(CBMEM_ID_MEMINFO); if (meminfo == NULL) - return 0; /* can't find mem info in cbmem */ + return 0; /* can't find mem info in cbmem */
printk(BIOS_INFO, "Create SMBIOS type 20\n"); for (i = 0; i < meminfo->dimm_cnt && i < ARRAY_SIZE(meminfo->dimm); i++) { @@ -1080,24 +1067,19 @@
u32 end_addr = start_addr + (dimm->dimm_size << 10) - 1; totallen += smbios_write_type20_table(current, handle, start_addr, end_addr, - type17_handle, type19_handle); + type17_handle, type19_handle); start_addr = end_addr + 1; } return totallen; }
-int smbios_write_type28(unsigned long *current, int *handle, - const char *name, +int smbios_write_type28(unsigned long *current, int *handle, const char *name, const enum smbios_temp_location location, - const enum smbios_temp_status status, - u16 max_value, u16 min_value, - u16 resolution, u16 tolerance, - u16 accuracy, - u32 oem, - u16 nominal_value) + const enum smbios_temp_status status, u16 max_value, u16 min_value, + u16 resolution, u16 tolerance, u16 accuracy, u32 oem, u16 nominal_value) { - struct smbios_type28 *t = smbios_carve_table(*current, SMBIOS_TEMPERATURE_PROBE, - sizeof(*t), *handle); + struct smbios_type28 *t = + smbios_carve_table(*current, SMBIOS_TEMPERATURE_PROBE, sizeof(*t), *handle);
t->description = smbios_add_string(t->eos, name ? name : "Temperature"); t->location_and_status = location | (status << 5); @@ -1126,10 +1108,9 @@ }
int smbios_write_type38(unsigned long *current, int *handle, - const enum smbios_bmc_interface_type interface_type, - const u8 ipmi_rev, const u8 i2c_addr, const u8 nv_addr, - const u64 base_addr, const u8 base_modifier, - const u8 irq) + const enum smbios_bmc_interface_type interface_type, const u8 ipmi_rev, + const u8 i2c_addr, const u8 nv_addr, const u64 base_addr, + const u8 base_modifier, const u8 irq) { struct smbios_type38 *t = smbios_carve_table(*current, SMBIOS_IPMI_DEVICE_INFORMATION, sizeof(*t), *handle); @@ -1148,16 +1129,13 @@ return len; }
-int smbios_write_type39(unsigned long *current, int *handle, - u8 unit_group, const char *loc, const char *dev_name, - const char *man, const char *serial_num, - const char *tag_num, const char *part_num, - const char *rev_lvl, u16 max_pow_cap, - const struct power_supply_ch *ps_ch) +int smbios_write_type39(unsigned long *current, int *handle, u8 unit_group, const char *loc, + const char *dev_name, const char *man, const char *serial_num, + const char *tag_num, const char *part_num, const char *rev_lvl, + u16 max_pow_cap, const struct power_supply_ch *ps_ch) { - struct smbios_type39 *t = smbios_carve_table(*current, - SMBIOS_SYSTEM_POWER_SUPPLY, - sizeof(*t), *handle); + struct smbios_type39 *t = + smbios_carve_table(*current, SMBIOS_SYSTEM_POWER_SUPPLY, sizeof(*t), *handle);
uint16_t val = 0; uint16_t ps_type, ps_status, vol_switch, ps_unplug, ps_present, hot_rep; @@ -1197,13 +1175,11 @@ return len; }
-int smbios_write_type41(unsigned long *current, int *handle, - const char *name, u8 instance, u16 segment, - u8 bus, u8 device, u8 function, u8 device_type) +int smbios_write_type41(unsigned long *current, int *handle, const char *name, u8 instance, + u16 segment, u8 bus, u8 device, u8 function, u8 device_type) { - struct smbios_type41 *t = smbios_carve_table(*current, - SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION, - sizeof(*t), *handle); + struct smbios_type41 *t = smbios_carve_table( + *current, SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION, sizeof(*t), *handle);
t->reference_designation = smbios_add_string(t->eos, name); t->device_type = device_type; @@ -1221,12 +1197,12 @@ }
int smbios_write_type43(unsigned long *current, int *handle, const u32 vendor_id, - const u8 major_spec_ver, const u8 minor_spec_ver, - const u32 fw_ver1, const u32 fw_ver2, const char *description, - const u64 characteristics, const u32 oem_defined) + const u8 major_spec_ver, const u8 minor_spec_ver, const u32 fw_ver1, + const u32 fw_ver2, const char *description, const u64 characteristics, + const u32 oem_defined) { - struct smbios_type43 *t = smbios_carve_table(*current, SMBIOS_TPM_DEVICE, - sizeof(*t), *handle); + struct smbios_type43 *t = + smbios_carve_table(*current, SMBIOS_TPM_DEVICE, sizeof(*t), *handle);
t->vendor_id = vendor_id; t->major_spec_ver = major_spec_ver; @@ -1245,8 +1221,8 @@
static int smbios_write_type127(unsigned long *current, int handle) { - struct smbios_type127 *t = smbios_carve_table(*current, SMBIOS_END_OF_TABLE, - sizeof(*t), handle); + struct smbios_type127 *t = + smbios_carve_table(*current, SMBIOS_END_OF_TABLE, sizeof(*t), handle);
const int len = smbios_full_table_len(&t->header, t->eos); *current += len; @@ -1296,8 +1272,8 @@ #else static u8 type41_inst_cnt[SMBIOS_DEVICE_TYPE_COUNT + 1] = {};
- if (device_type == SMBIOS_DEVICE_TYPE_OTHER || - device_type == SMBIOS_DEVICE_TYPE_UNKNOWN) + if (device_type == SMBIOS_DEVICE_TYPE_OTHER + || device_type == SMBIOS_DEVICE_TYPE_UNKNOWN) return false;
if (device_type > SMBIOS_DEVICE_TYPE_COUNT) @@ -1335,13 +1311,13 @@ const char *name = smbios_get_type41_refdes(dev);
return smbios_write_type41(current, handle, - name, // name - instance_id, // inst - 0, // segment - dev->bus->secondary, //bus - PCI_SLOT(dev->path.pci.devfn), // device - PCI_FUNC(dev->path.pci.devfn), // func - device_type); + name, // name + instance_id, // inst + 0, // segment + dev->bus->secondary, // bus + PCI_SLOT(dev->path.pci.devfn), // device + PCI_FUNC(dev->path.pci.devfn), // func + device_type); }
static int smbios_generate_type9_from_devtree(struct device *dev, int *handle, @@ -1355,8 +1331,8 @@ if (dev->path.type != DEVICE_PATH_PCI) return 0;
- if (!dev->smbios_slot_type && !dev->smbios_slot_data_width && - !dev->smbios_slot_designation && !dev->smbios_slot_length) + if (!dev->smbios_slot_type && !dev->smbios_slot_data_width + && !dev->smbios_slot_designation && !dev->smbios_slot_length) return 0;
if (dev_is_active_bridge(dev)) @@ -1381,16 +1357,8 @@ else length = SlotLengthUnknown;
- return smbios_write_type9(current, handle, - dev->smbios_slot_designation, - type, - bandwidth, - usage, - length, - 0, - 1, - 0, - dev->bus->secondary, + return smbios_write_type9(current, handle, dev->smbios_slot_designation, type, + bandwidth, usage, length, 0, 1, 0, dev->bus->secondary, dev->path.pci.devfn); }
@@ -1457,8 +1425,7 @@ len += smbios_write_type7_cache_parameters(¤t, &handle, &max_struct_size, type4); update_max(len, max_struct_size, smbios_write_type11(¤t, &handle)); if (CONFIG(ELOG)) - update_max(len, max_struct_size, - elog_smbios_write_type15(¤t, handle++)); + update_max(len, max_struct_size, elog_smbios_write_type15(¤t, handle++));
const int type16 = handle; update_max(len, max_struct_size, smbios_write_type16(¤t, &handle)); @@ -1467,11 +1434,11 @@ const int type19 = handle; update_max(len, max_struct_size, smbios_write_type19(¤t, &handle, type16)); update_max(len, max_struct_size, - smbios_write_type20(¤t, &handle, type17, type19)); + smbios_write_type20(¤t, &handle, type17, type19)); update_max(len, max_struct_size, smbios_write_type32(¤t, handle++));
- update_max(len, max_struct_size, smbios_walk_device_tree(all_devices, - &handle, ¤t)); + update_max(len, max_struct_size, + smbios_walk_device_tree(all_devices, &handle, ¤t));
update_max(len, max_struct_size, smbios_write_type127(¤t, handle++));
diff --git a/src/arch/x86/smbios_defaults.c b/src/arch/x86/smbios_defaults.c index 8b62ebb..c2a0570 100644 --- a/src/arch/x86/smbios_defaults.c +++ b/src/arch/x86/smbios_defaults.c @@ -10,8 +10,8 @@ { char locator[40];
- snprintf(locator, sizeof(locator), "Channel-%d-DIMM-%d", - dimm->channel_num, dimm->dimm_num); + snprintf(locator, sizeof(locator), "Channel-%d-DIMM-%d", dimm->channel_num, + dimm->dimm_num); t->device_locator = smbios_add_string(t->eos, locator);
snprintf(locator, sizeof(locator), "BANK %d", dimm->bank_locator); @@ -22,8 +22,8 @@ { char buf[40];
- snprintf(buf, sizeof(buf), "Channel-%d-DIMM-%d-AssetTag", - dimm->channel_num, dimm->dimm_num); + snprintf(buf, sizeof(buf), "Channel-%d-DIMM-%d-AssetTag", dimm->channel_num, + dimm->dimm_num); t->asset_tag = smbios_add_string(t->eos, buf); }