[PATCH 4/4] umr: Fix unhandled enumeration value in switch

StDenis, Tom Tom.StDenis at amd.com
Thu Mar 10 14:22:03 UTC 2022


[AMD Official Use Only]

Patches 2-4 look great.  With #1 swapped out to use asic->errmsg() you can throw my Rb on them.

Tom

________________________________________
From: Tuikov, Luben <Luben.Tuikov at amd.com>
Sent: Wednesday, March 9, 2022 19:42
To: amd-gfx at lists.freedesktop.org
Cc: Tuikov, Luben; Deucher, Alexander; StDenis, Tom
Subject: [PATCH 4/4] umr: Fix unhandled enumeration value in switch

Add a default case in the switch, instead of the last unhandled value,
FAMILY_CONFIGURE. This solves the case when in the future other families
are not handled--they'll all fall into the default case.

Also, in the diagnostic print, print the value of the unhandled
enumeration--this could help debug easily, as opposed to having to
reproduce the issue locally.

Cc: Alex Deucher <Alexander.Deucher at amd.com>
Cc: Tom StDenis <tom.stdenis at amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov at amd.com>
---
 src/lib/ih_decode_vectors.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/ih_decode_vectors.c b/src/lib/ih_decode_vectors.c
index ed5705059c542f..f2057df825f5c0 100644
--- a/src/lib/ih_decode_vectors.c
+++ b/src/lib/ih_decode_vectors.c
@@ -77,11 +77,11 @@ int umr_ih_decode_vectors(struct umr_asic *asic, struct umr_ih_decode_ui *ui, ui
                }
                return off / 8;

-       case FAMILY_CONFIGURE:
        case FAMILY_SI:
        case FAMILY_CIK:
        case FAMILY_NPI:
-               asic->err_msg("[BUG]: unhandled family case in umr_ih_decode_vectors()\n");
+       default:
+               asic->err_msg("[BUG]: unhandled family case:%d in umr_ih_decode_vectors()\n", asic->family);
                return -1;
        }
        return 0;
--
2.35.1.291.gdab1b7905d



More information about the amd-gfx mailing list