Skip to contentSkip to conversation

drm/amd/display: Clean up errors in bios_parser2.c

PATCH Applied Ran Sun 2 participants 2 messages Aug 2, 2023 – Aug 7, 2023

Subsystems (3)
lore
Share & tools
lore

Ran Sun

author
#0 lore raw

PATCH 1/1 drm/amd/display: Clean up errors in bios_parser2.c

Fix the following errors reported by checkpatch:

ERROR: switch and case should be at the same indent
ERROR: code indent should use tabs where possible

---
 .../drm/amd/display/dc/bios/bios_parser2.c    | 32 +++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +16 -16
index 540d19efad8f..033ce2638eb2 100644
@@ -772,20 +772,20 @@ static enum bp_result bios_parser_get_device_tag(
 		return BP_RESULT_BADINPUT;
 
 	switch (bp->object_info_tbl.revision.minor) {
-	    case 4:
-	    default:
+	case 4:
+	default:
 	        /* getBiosObject will return MXM object */
-	        object = get_bios_object(bp, connector_object_id);
+		object = get_bios_object(bp, connector_object_id);
 
 		if (!object) {
 			BREAK_TO_DEBUGGER(); /* Invalid object id */
 			return BP_RESULT_BADINPUT;
 		}
 
-	        info->acpi_device = 0; /* BIOS no longer provides this */
-	        info->dev_id = device_type_from_device_id(object->device_tag);
-	        break;
-	    case 5:
+		info->acpi_device = 0; /* BIOS no longer provides this */
+		info->dev_id = device_type_from_device_id(object->device_tag);
+		break;
+	case 5:
 		object_path_v3 = get_bios_object_from_path_v3(bp, connector_object_id);
 
 		if (!object_path_v3) {
@@ -1580,13 +1580,13 @@ static bool bios_parser_is_device_id_supported(
 	uint32_t mask = get_support_mask_for_device_id(id);
 
 	switch (bp->object_info_tbl.revision.minor) {
-	    case 4:
-	    default:
-	        return (le16_to_cpu(bp->object_info_tbl.v1_4->supporteddevices) & mask) != 0;
-			break;
-	    case 5:
-			return (le16_to_cpu(bp->object_info_tbl.v1_5->supporteddevices) & mask) != 0;
-			break;
+	case 4:
+	default:
+		return (le16_to_cpu(bp->object_info_tbl.v1_4->supporteddevices) & mask) != 0;
+		break;
+	case 5:
+		return (le16_to_cpu(bp->object_info_tbl.v1_5->supporteddevices) & mask) != 0;
+		break;
 	}
 
 	return false;
@@ -1755,7 +1755,7 @@ static enum bp_result bios_parser_get_firmware_info(
 			case 2:
 			case 3:
 				result = get_firmware_info_v3_2(bp, info);
-                                break;
+			break;
 			case 4:
 				result = get_firmware_info_v3_4(bp, info);
 				break;
@@ -2225,7 +2225,7 @@ static enum bp_result bios_parser_get_disp_connector_caps_info(
 		return BP_RESULT_BADINPUT;
 
 	switch (bp->object_info_tbl.revision.minor) {
-	    case 4:
+	case 4:
 	    default:
 		    object = get_bios_object(bp, object_id);
 
Signature · 1 line
2.17.1
Applied
#1 lore raw

Applied. Thanks!

As a follow up patch, care to drop the break statements after a return?

Quoted 85 lines · Ran Sun

Fix the following errors reported by checkpatch:

ERROR: switch and case should be at the same indent
ERROR: code indent should use tabs where possible

---
 .../drm/amd/display/dc/bios/bios_parser2.c    | 32 +++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +16 -17
index 540d19efad8f..033ce2638eb2 100644
@@ -772,20 +772,20 @@ static enum bp_result bios_parser_get_device_tag(
                return BP_RESULT_BADINPUT;
 
        switch (bp->object_info_tbl.revision.minor) {
-           case 4:
-           default:
+       case 4:
+       default:
                /* getBiosObject will return MXM object */
-               object = get_bios_object(bp, connector_object_id);
+               object = get_bios_object(bp, connector_object_id);
 
                if (!object) {
                        BREAK_TO_DEBUGGER(); /* Invalid object id */
                        return BP_RESULT_BADINPUT;
                }
 
-               info->acpi_device = 0; /* BIOS no longer provides this */
-               info->dev_id = device_type_from_device_id(object->device_tag);
-               break;
-           case 5:
+               info->acpi_device = 0; /* BIOS no longer provides this */
+               info->dev_id = device_type_from_device_id(object->device_tag);
+               break;
+       case 5:
                object_path_v3 = get_bios_object_from_path_v3(bp, connector_object_id);
 
                if (!object_path_v3) {
@@ -1580,13 +1580,13 @@ static bool bios_parser_is_device_id_supported(
        uint32_t mask = get_support_mask_for_device_id(id);
 
        switch (bp->object_info_tbl.revision.minor) {
-           case 4:
-           default:
-               return (le16_to_cpu(bp->object_info_tbl.v1_4->supporteddevices) & mask) != 0;
-                       break;
-           case 5:
-                       return (le16_to_cpu(bp->object_info_tbl.v1_5->supporteddevices) & mask) != 0;
-                       break;
+       case 4:
+       default:
+               return (le16_to_cpu(bp->object_info_tbl.v1_4->supporteddevices) & mask) != 0;
+               break;
+       case 5:
+               return (le16_to_cpu(bp->object_info_tbl.v1_5->supporteddevices) & mask) != 0;
+               break;
        }
 
        return false;
@@ -1755,7 +1755,7 @@ static enum bp_result bios_parser_get_firmware_info(
                        case 2:
                        case 3:
                                result = get_firmware_info_v3_2(bp, info);
-                                break;
+                       break;
                        case 4:
                                result = get_firmware_info_v3_4(bp, info);
                                break;
@@ -2225,7 +2225,7 @@ static enum bp_result bios_parser_get_disp_connector_caps_info(
                return BP_RESULT_BADINPUT;
 
        switch (bp->object_info_tbl.revision.minor) {
-           case 4:
+       case 4:
            default:
                    object = get_bios_object(bp, object_id);
 
--

2.17.1