git: e93c021d2276 - stable/15 - snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Tue, 31 Mar 2026 09:54:56 UTC
The branch stable/15 has been updated by christos:

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

commit e93c021d227625cd3bc2e2c5474302db2044094b
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-03-24 10:30:58 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-03-31 09:53:16 +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
    
    (cherry picked from commit 039477d3e7e72285174d83b973e58cea8de85280)
---
 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)