From: chris@kode54.net
To: Takashi Iwai <tiwai@suse.com>, Jaroslav Kysela <perex@perex.cz>
Cc: Christopher Snowhill <chris@kode54.net>,
Cryolitia PukNgae <cryolitia@uniontech.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] ALSA: usb-audio: Ignore trailing whitespace in quirk_flags
Date: Fri, 20 Nov 2026 04:03:47 -0800 [thread overview]
Message-ID: <20261120120356.10909-2-chris@kode54.net> (raw)
In-Reply-To: <20261120120356.10909-1-chris@kode54.net>
Writing a flag name to the quirk_flags module parameter through sysfs
with echo leaves a trailing newline on the string. The parser keeps it
as part of the last flag name, so a valid flag is rejected:
snd_usb_audio: unknown flag SKIP_IFACE_SETUP
while parsing param quirk_flags
Numeric flags are not affected because kstrtou64() accepts a trailing
newline. Strip leading and trailing whitespace before parsing.
Fixes: ffd586126a82 ("ALSA: usb-audio: improve module param quirk_flags")
Assisted-by: AI
Signed-off-by: Christopher Snowhill <chris@kode54.net>
---
sound/usb/quirks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index a54fabce7920..cff10fac496f 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -2765,7 +2765,7 @@ void snd_usb_init_quirk_flags_parse_string(struct snd_usb_audio *chip,
if (!val)
return;
- for (p = val; p && *p;) {
+ for (p = strim(val); p && *p;) {
/* Each entry consists of VID:PID:flags */
field = strsep(&p, ":");
if (!field)
--
2.56.0
next prev parent reply other threads:[~2026-11-20 12:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 12:03 [PATCH 0/2] ALSA: usb-audio: quirk_flags parsing fix and Logitech PRO X 2 LIGHTSPEED quirk chris
2026-11-20 12:03 ` chris [this message]
2026-11-20 12:03 ` [PATCH 2/2] ALSA: usb-audio: Add quirk flags for Logitech PRO X 2 LIGHTSPEED chris
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=20261120120356.10909-2-chris@kode54.net \
--to=chris@kode54.net \
--cc=cryolitia@uniontech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®