Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 May 2024 18:36:32 GMT
From:      Christos Margiolis <christos@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 76f95bae092b - main - sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove()
Message-ID:  <202405061836.446IaWt2059986@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202405061836.446IaWt2059986>