git: 76f95bae092b - main - sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove()

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Mon, 06 May 2024 18:36:32 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=76f95bae092b7353ff82b7a0056ca5801bb98f76

commit 76f95bae092b7353ff82b7a0056ca5801bb98f76
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2024-05-06 18:26:56 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2024-05-06 18:26:56 +0000

    sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove()
    
    We should normally never enter these cases.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    markj, emaste
    Differential Revision:  https://reviews.freebsd.org/D44994
---
 sys/dev/sound/pcm/sound.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index cc19d119ac36..2787c0ee126d 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -403,7 +403,7 @@ pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch)
 		d->rvchancount++;
 		break;
 	default:
-		break;
+		__assert_unreachable();
 	}
 
 	return (0);
@@ -443,7 +443,7 @@ pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch)
 		d->rvchancount--;
 		break;
 	default:
-		break;
+		__assert_unreachable();
 	}
 
 	return (0);