From patchwork Thu Oct 20 20:46:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej S. Szmigiero" X-Patchwork-Id: 6394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp316134wrr; Thu, 20 Oct 2022 13:48:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4yPvAha6QmIo0LoLAkEC8kGIf6rUuUGgVvXebb48tlkDcQMl3BEYz2S/FZhLfSXvZaJFls X-Received: by 2002:a17:906:5daa:b0:791:8933:f9f0 with SMTP id n10-20020a1709065daa00b007918933f9f0mr12497516ejv.335.1666298929821; Thu, 20 Oct 2022 13:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666298929; cv=none; d=google.com; s=arc-20160816; b=BMe8H9Un8c7wWzIKCleUUa+DVo3m9NqL26VEbNauuG7AbvGv6IO1k6os+H+kS23Sau dyieBgnhjxNDggc/dGn8kQ0gxJWOqMcrbAXti4J/VOfe7jxiT4RefwAs5QpkWsbaSenu hVBIPIA7CP60+C7VnyOAiIw2w1tarh2x/xGVIRtZGHGi5lW3Ijez+Nkltdo+SdGaF8M2 6z0uG3uKtMxQVy4Qw5z1jlDoFy/+fpIojxtVqraBKqW8vW1yG9ge0HiyIV5gI9LH1xAf iUkQkujdSCe6KeVMF2w/iJJio/gP/Q5VJlkfSJp3tdhL2EMBv75gfIicPbeq287JDSZ0 X8iQ== 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=tvMAfDZYwsEuZciMyTG0kmHNr3e12NZWFmA6tvxfFeQ=; b=NGnqDbzZotGkNs12AK0p80bbzXrcjjdvQGz8e2JT+mMZtPGxTjMAfwnRvWsTq+Tx1U NHq1VRimKS9SzdiLXdXZTpIt95HYeEoL3a/ElLZKTVmmZJ1ebaft+/fCLNGo9/VpzMzE 3IJPjkGzeMWvkvhyZ928c362YR0kiNzdQ58hEMs41UwvuSUjmF7EECee06XassospAzF voJxQsjmcdO2TLO7fFE2Vp6JDE7jjZy54Iy1eKDd9CASue/4irWo4PC1pVMr8m7G9vh1 HY++hgTzRcgFqvcPMAtgarQz5aF3G4gCiQUCrd7ttJacJbkSNQ2j07Aj+Sq+u37iTS5G oDkQ== 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 q7-20020a1709060e4700b0078e176ef65csi15560063eji.723.2022.10.20.13.48.26; Thu, 20 Oct 2022 13:48:49 -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 S229917AbiJTUrr (ORCPT + 99 others); Thu, 20 Oct 2022 16:47:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbiJTUri (ORCPT ); Thu, 20 Oct 2022 16:47:38 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABF5521F96D for ; Thu, 20 Oct 2022 13:47:26 -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 ) id 1olcRE-0007V3-Jm; Thu, 20 Oct 2022 22:46:48 +0200 From: "Maciej S. Szmigiero" To: Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] ALSA: hda/realtek: Use snd_ctl_rename() to rename a control Date: Thu, 20 Oct 2022 22:46:23 +0200 Message-Id: <37496bd80f91f373268148f877fd735917d97287.1666296963.git.maciej.szmigiero@oracle.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747241066577681131?= X-GMAIL-MSGID: =?utf-8?q?1747241066577681131?= From: "Maciej S. Szmigiero" 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 --- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 79acd2a2caf20..9945861f02efa 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -2142,7 +2142,7 @@ static void rename_ctl(struct hda_codec *codec, const char *oldname, kctl = snd_hda_find_mixer_ctl(codec, oldname); if (kctl) - strcpy(kctl->id.name, newname); + snd_ctl_rename(codec->card, kctl, newname); } static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,