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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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@xxxxxxx>
Sent: Wednesday, March 9, 2022 19:42
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
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@xxxxxxx>
Cc: Tom StDenis <tom.stdenis@xxxxxxx>
Signed-off-by: Luben Tuikov <luben.tuikov@xxxxxxx>
---
 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





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux