Message ID | 723877882e3a56bb42a2a2214cfc85f347d36e19.1666296963.git.maciej.szmigiero@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp315989wrr; Thu, 20 Oct 2022 13:48:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49L/m/fNMkBTpw4qAy+1i2PeSZ6o5v+dwzRn12xaWnXsYRyiX0mf50/1wgmSoIqnroqdZU X-Received: by 2002:aa7:c054:0:b0:453:98c6:f6c4 with SMTP id k20-20020aa7c054000000b0045398c6f6c4mr13863681edo.2.1666298901394; Thu, 20 Oct 2022 13:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666298901; cv=none; d=google.com; s=arc-20160816; b=W2/EGhCVT7z0LSPQEHeC/vE11SwNJs7lS+bQZLCalp7bBPYGWZs3l0ChyNiHKXcO7g nnRym6JRzoO8/df/4PQYsOaryXp0F+cgypvPM5lOQL9mzXprsn10rUGPs89koKq1TgeR SqkXfAik5Z3zPCKlS189R0rpdEYmqAWV8iInrIJq4ANqsKOMS74gVam1BAc03R1CKMoW m0t2ha69QCzIs7Epg60dISL+nqn2xiIYA8At8fEgsPFAH022tkWQRd05jFD1e+DOipRD pCQxzFlPzjgwjlWXPrbD6QPV+BrtLDBuPoTI14x+OnX0VI9mw42FnPvobk2UFaSZIimx RXVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=3fCsTwB7TQ9uC8UPZ+BwI1sCJTZmBJ7NrtHuUkE2UP0=; b=y5Vi9AJfMIDpefQ5fxxLeqd47+P7+C7PHi5NipXTAupBS/qbCe6nfUTy3UR4Ue24/r NFBE/FERD9YSPKXRyFk8JaoEzifx6g7RjylJ+2pzyaHLbWaTJ6sYltWy2/rfrWh30/4k 8k439fu42YuNy0nfVI3cZ3BRLtZVyiXiFckMlaXn2MCHHoQs1PclAfZQk+U9GmE0Yc1i w+7iXh1klf8ISQhgsNp/LPN8p0M7Qn1lomQE1f96FMQ83rwWtsXI7kNRLIiqIhtdoe6j pmN5lD1h9DYb2YJMBSC/KWmY3OH/FEuF1OLia1eJCpvfaUK/B7aLDuNq1m26/JsJwvmY jaow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr8-20020a170907720800b006feb76dbd51si18709545ejc.289.2022.10.20.13.47.57; Thu, 20 Oct 2022 13:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbiJTUrf (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Thu, 20 Oct 2022 16:47:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbiJTUrd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Oct 2022 16:47:33 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B91597B59E for <linux-kernel@vger.kernel.org>; Thu, 20 Oct 2022 13:47:24 -0700 (PDT) Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <mail@maciej.szmigiero.name>) id 1olcR9-0007Ur-7p; Thu, 20 Oct 2022 22:46:43 +0200 From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name> To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] ALSA: usb-audio: Use snd_ctl_rename() to rename a control Date: Thu, 20 Oct 2022 22:46:22 +0200 Message-Id: <723877882e3a56bb42a2a2214cfc85f347d36e19.1666296963.git.maciej.szmigiero@oracle.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <cover.1666296963.git.maciej.szmigiero@oracle.com> References: <cover.1666296963.git.maciej.szmigiero@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747241036493679021?= X-GMAIL-MSGID: =?utf-8?q?1747241036493679021?= |
Series |
Fix direct renaming of hashed controls
|
|
Commit Message
Maciej S. Szmigiero
Oct. 20, 2022, 8:46 p.m. UTC
From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com> With the recent addition of hashed controls lookup it's not enough to just update the control name field, the hash entries for the modified control have to be updated too. snd_ctl_rename() takes care of that, so use it instead of directly modifying the control name. Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> --- sound/usb/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index a5641956ef102..9105ec623120a 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1631,7 +1631,7 @@ static void check_no_speaker_on_headset(struct snd_kcontrol *kctl, if (!found) return; - strscpy(kctl->id.name, "Headphone", sizeof(kctl->id.name)); + snd_ctl_rename(card, kctl, "Headphone"); } static const struct usb_feature_control_info *get_feature_control_info(int control)