From patchwork Thu Oct 20 20:46:25 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: 6396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp316442wrr; Thu, 20 Oct 2022 13:49:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4lZzSFIimKD3xkwloHQO4ojpgiBpbt/FcFSLPV5H/1+OSu3siHCn31Sg9BDTqcF9Rh0fUZ X-Received: by 2002:a05:6402:370c:b0:453:9fab:1b53 with SMTP id ek12-20020a056402370c00b004539fab1b53mr14277721edb.28.1666298982066; Thu, 20 Oct 2022 13:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666298982; cv=none; d=google.com; s=arc-20160816; b=EsNIz33wfpIOMcDK6SN7Vv2LIjStBO93kv1R+g4xCEgqu1ahTdRT0yq8/BmsRRDjDf 55oc/cuWxhjpUPGYZ3ALgmwiKc2rbfVOCVlG/g6TjsyZxwoCaMZaqgSqRYfuV5/AYOJf oOJqjDCy2sVF+sZ15ivBXR6z7cGVQD8UrEu0ZCTX62/wa1RTRuMNGT1BgxMnLjOQq3iy QX7TK2qjXh4LknYlKujoDEMLOUI6/tA4QAO5Gn89LFi+JfbI+Gimi9MqfLqZwNAzFdHH mAVpRKsjy0T7AKYeGuZ/3Z10Zh2R7bWe/jABPBOntu9aMWmiHiIa51SwIR1COEIChI1Y L5Mw== 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=VTp+kTu8Dsz+y7sHpJtKzqGBm65dsd21gc11j8E9Gig=; b=FoBBsE4DhB7g2dITZ/Hxg7Rw13wSZ42g//Vjv7ZCderUj1advgV0U40VZnbt9pkcWM kW4+JEj9Rdjm+Ew+/mwV0DPuOBEJn1rHK6vAVb6cjstwX7Jh0T0wY0/ybcODnzsE6A4Z SmPvkRo3rrMpUzERuMQkz1d9VxAx5mxwDeNdiweLZz1l/zkpAzUz1y8RLa7EQrKpU+eB qVp4Ib/WJzgvZg7uMuSQwUTjLM4pMOwAlTh525PBrmyLj1ce3pPvHJKaQyu4LxR8fqdx bS/FA7OB/KLE4I9bgsJ7UvRYQRrOWPWB6t7t3QM8jFqKOqC3Kp3lmD69rxQCLxKsY0KG oqBQ== 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 lt4-20020a170906fa8400b0078d8b6976eesi15190976ejb.140.2022.10.20.13.49.17; Thu, 20 Oct 2022 13:49:42 -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 S229972AbiJTUr4 (ORCPT + 99 others); Thu, 20 Oct 2022 16:47:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbiJTUro (ORCPT ); Thu, 20 Oct 2022 16:47:44 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586335B730 for ; Thu, 20 Oct 2022 13:47:31 -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 1olcRP-0007VS-7d; Thu, 20 Oct 2022 22:46:59 +0200 From: "Maciej S. Szmigiero" To: Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] ALSA: ca0106: Use snd_ctl_rename() to rename a control Date: Thu, 20 Oct 2022 22:46:25 +0200 Message-Id: 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?1747241121331998921?= X-GMAIL-MSGID: =?utf-8?q?1747241121331998921?= 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/ca0106/ca0106_mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c index 05f56015ddd87..f6381c098d4f6 100644 --- a/sound/pci/ca0106/ca0106_mixer.c +++ b/sound/pci/ca0106/ca0106_mixer.c @@ -720,7 +720,7 @@ static int rename_ctl(struct snd_card *card, const char *src, const char *dst) { struct snd_kcontrol *kctl = ctl_find(card, src); if (kctl) { - strcpy(kctl->id.name, dst); + snd_ctl_rename(card, kctl, dst); return 0; } return -ENOENT;