util/{cbfstool,nvramtool}: Use same indent levels for switch/case

Use same indent levels for switch/case in order to comply with the
linter.

Change-Id: I2dd0c2ccc4f4ae7af7dd815723adf757244d2005
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79448
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Eric Lai <ericllai@google.com>
This commit is contained in:
Felix Singer 2023-12-08 11:11:56 +01:00 committed by Felix Singer
parent df98b8168f
commit 68a4c2ae8d
2 changed files with 60 additions and 60 deletions

View File

@ -1374,44 +1374,44 @@ static int cbfs_print_decoded_payload_segment_info(
* cbfs_decode_payload_segment.
*/
switch (seg->type) {
case PAYLOAD_SEGMENT_CODE:
case PAYLOAD_SEGMENT_DATA:
fprintf(fp, " %s (%s compression, offset: 0x%x, "
"load: 0x%" PRIx64 ", length: %d/%d)\n",
(seg->type == PAYLOAD_SEGMENT_CODE ?
"code " : "data"),
lookup_name_by_type(types_cbfs_compression,
seg->compression,
"(unknown)"),
seg->offset, seg->load_addr, seg->len,
seg->mem_len);
break;
case PAYLOAD_SEGMENT_CODE:
case PAYLOAD_SEGMENT_DATA:
fprintf(fp, " %s (%s compression, offset: 0x%x, "
"load: 0x%" PRIx64 ", length: %d/%d)\n",
(seg->type == PAYLOAD_SEGMENT_CODE ?
"code " : "data"),
lookup_name_by_type(types_cbfs_compression,
seg->compression,
"(unknown)"),
seg->offset, seg->load_addr, seg->len,
seg->mem_len);
break;
case PAYLOAD_SEGMENT_ENTRY:
fprintf(fp, " entry (0x%" PRIx64 ")\n",
seg->load_addr);
break;
case PAYLOAD_SEGMENT_ENTRY:
fprintf(fp, " entry (0x%" PRIx64 ")\n",
seg->load_addr);
break;
case PAYLOAD_SEGMENT_BSS:
fprintf(fp, " BSS (address 0x%016" PRIx64 ", "
"length 0x%x)\n",
seg->load_addr, seg->len);
break;
case PAYLOAD_SEGMENT_BSS:
fprintf(fp, " BSS (address 0x%016" PRIx64 ", "
"length 0x%x)\n",
seg->load_addr, seg->len);
break;
case PAYLOAD_SEGMENT_PARAMS:
fprintf(fp, " parameters\n");
break;
case PAYLOAD_SEGMENT_PARAMS:
fprintf(fp, " parameters\n");
break;
default:
fprintf(fp, " 0x%x (%s compression, offset: 0x%x, "
"load: 0x%" PRIx64 ", length: %d/%d\n",
seg->type,
lookup_name_by_type(types_cbfs_compression,
seg->compression,
"(unknown)"),
seg->offset, seg->load_addr, seg->len,
seg->mem_len);
break;
default:
fprintf(fp, " 0x%x (%s compression, offset: 0x%x, "
"load: 0x%" PRIx64 ", length: %d/%d\n",
seg->type,
lookup_name_by_type(types_cbfs_compression,
seg->compression,
"(unknown)"),
seg->offset, seg->load_addr, seg->len,
seg->mem_len);
break;
}
return 0;
}
@ -1484,26 +1484,26 @@ int cbfs_print_entry_info(struct cbfs_image *image, struct cbfs_file *entry,
/* note the components of the subheader may be in host order ... */
switch (be32toh(entry->type)) {
case CBFS_TYPE_STAGE:
cbfs_print_stage_info(entry, fp);
break;
case CBFS_TYPE_STAGE:
cbfs_print_stage_info(entry, fp);
break;
case CBFS_TYPE_SELF:
payload = (struct cbfs_payload_segment *)
CBFS_SUBHEADER(entry);
while (payload) {
struct cbfs_payload_segment seg;
cbfs_decode_payload_segment(&seg, payload);
cbfs_print_decoded_payload_segment_info(
&seg, fp);
if (seg.type == PAYLOAD_SEGMENT_ENTRY)
break;
else
payload ++;
}
break;
default:
break;
case CBFS_TYPE_SELF:
payload = (struct cbfs_payload_segment *)
CBFS_SUBHEADER(entry);
while (payload) {
struct cbfs_payload_segment seg;
cbfs_decode_payload_segment(&seg, payload);
cbfs_print_decoded_payload_segment_info(
&seg, fp);
if (seg.type == PAYLOAD_SEGMENT_ENTRY)
break;
else
payload ++;
}
break;
default:
break;
}
return 0;
}

View File

@ -22,14 +22,14 @@ void select_hal(hal_t hal, void *data)
{
switch(hal) {
#ifdef CMOS_HAL
case HAL_CMOS:
current_access = &cmos_hal;
break;
case HAL_CMOS:
current_access = &cmos_hal;
break;
#endif
case HAL_MEMORY:
default:
current_access = &memory_hal;
break;
case HAL_MEMORY:
default:
current_access = &memory_hal;
break;
}
current_access->init(data);
}