git: 039477d3e7e7 - main - snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Tue, 24 Mar 2026 10:38:50 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=039477d3e7e72285174d83b973e58cea8de85280

commit 039477d3e7e72285174d83b973e58cea8de85280
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-03-24 10:30:58 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-03-24 10:38:39 +0000

    snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D55918
---
 sys/dev/sound/usb/uaudio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index 12e01599b200..b74cba611b24 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -5805,9 +5805,7 @@ tr_setup:
 				}
 			}
 
-			chan->curr_cable++;
-			if (chan->curr_cable >= chan->max_emb_jack)
-				chan->curr_cable = 0;
+			chan->curr_cable %= chan->max_emb_jack;
 
 			if (chan->curr_cable == start_cable) {
 				if (tr_any == 0)