From 68a4c2ae8dd42064955d8e7e7549876d63ae05bc Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Fri, 8 Dec 2023 11:11:56 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79448 Tested-by: build bot (Jenkins) Reviewed-by: Alexander Couzens Reviewed-by: Eric Lai --- util/cbfstool/cbfs_image.c | 106 ++++++++++++++++----------------- util/nvramtool/cmos_lowlevel.c | 14 ++--- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index 2842252585..1fde8cdfad 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -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; } diff --git a/util/nvramtool/cmos_lowlevel.c b/util/nvramtool/cmos_lowlevel.c index f37ea7ab52..8b56164284 100644 --- a/util/nvramtool/cmos_lowlevel.c +++ b/util/nvramtool/cmos_lowlevel.c @@ -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); }