All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben.tuikov@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alex Deucher <Alexander.Deucher@amd.com>,
	Tom StDenis <tom.stdenis@amd.com>,
	Luben Tuikov <luben.tuikov@amd.com>
Subject: [PATCH v1 4/4] umr: Fix unhandled enumeration value in switch
Date: Fri, 11 Mar 2022 19:52:06 -0500	[thread overview]
Message-ID: <20220312005206.26588-4-luben.tuikov@amd.com> (raw)
In-Reply-To: <20220312005206.26588-1-luben.tuikov@amd.com>

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@amd.com>
Cc: Tom StDenis <tom.stdenis@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Tom StDenis <tom.stdenis@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


      parent reply	other threads:[~2022-03-12  0:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-12  0:52 [PATCH v1 1/4] umr: Print errors to stderr Luben Tuikov
2022-03-12  0:52 ` [PATCH v1 2/4] umr: Fix ring-stream segmentation fault Luben Tuikov
2022-03-12  0:52 ` [PATCH v1 3/4] umr: Consistent indentation in switch Luben Tuikov
2022-03-12  0:52 ` Luben Tuikov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220312005206.26588-4-luben.tuikov@amd.com \
    --to=luben.tuikov@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=tom.stdenis@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.