Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp775741imm; Thu, 31 May 2018 09:11:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKjLBUQoPspH3shGVLjVGbWnJyLgQX+dKlRlR3Rp0Gt6WuHwtxAh6wmbjwI8ttrFdrjhst9 X-Received: by 2002:a65:6645:: with SMTP id z5-v6mr6063645pgv.43.1527783067437; Thu, 31 May 2018 09:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527783067; cv=none; d=google.com; s=arc-20160816; b=FKFeRkGGX1JKeez3wcgjW9JssaYQ353GDOf9yt6JIMrGcUlFomcMEt/MOaeYvSOx0z xb7bsAHLqUgtMmznUZm3WNDuKq2ifSKRrQ6Wq9QMxYiIelBY/0CD3nvHLXvJPJX14xxZ KpIfxSb37O22St0epYS5oO1QnW+nAPEiys1r2/c8vNaeMb8QRNSHDBhQqvuHjNZSU41f MFs2WHbsu8NG5MonTN3nA5mUqoqX+CShz3lb9EkUJl/5yYMUnV+wp157VGNpBdRBS3H+ BonahFbosruQ0y37utnk7865jKS/yMUYUUi+edygXQEHRiVeTQKkwHKqi5spS7V6/qCb rX5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=+qkFnSzjfC90qvh2Zqivze6FowAXonfB9ezpmrUkGOY=; b=fZJ/0mLbhtNbQ79RXK96ZdA9JYJgWMMc9oX2EtJy23BJOXTNAZ4sMdsSVcRoQDlTeE JqLK2jn93FM9aSJYeNT+uyVlojWECK9R5Rv4UuZKYpflmpq/mxIPahMxpyb+lwekYlv1 T9+Xuh9lIe8wfqQ2725jHYaH+ffdP6Vl9GVu59yuYu9Bu1D+Tcsr9p28Ml+JufzSBbp5 m+SD9Z6EHRNDjwAJl2RSUKXf+CG8zqTUtKWnlc42Grq7VItjS3HtAhh5iUPJJXcYEKQV HPsZ15H9Fzw0vNXhtXW1fDxkUkcF/8B3zy+w7MOfEf/bSo29kCnrgPTp7ceI7Ox+mqHp muwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=YlEYA2ZJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si16539007pli.201.2018.05.31.09.10.52; Thu, 31 May 2018 09:11:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=YlEYA2ZJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755636AbeEaQJt (ORCPT + 99 others); Thu, 31 May 2018 12:09:49 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:51480 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755615AbeEaQJo (ORCPT ); Thu, 31 May 2018 12:09:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=+qkFnSzjfC90qvh2Zqivze6FowAXonfB9ezpmrUkGOY=; b=YlEYA2ZJhMb5 /Ho5jYUp66BYgmO5LCIMUEMRbMEFWkdVOLqUqZdIImCv/3L6V0RBJwglmBzbIvD+ZBo9/8epDMb49 bi1IL/l4ecV8yHOpYFeedla2Z6KtLP1mTKmXvFwNyc99l2uxjZ2CK0tIYA2TeDDEkHYd2LvZnaHZ0 4PNCo=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOQ90-0000Iq-5K; Thu, 31 May 2018 16:09:42 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fOQ8z-0003BE-Nh; Thu, 31 May 2018 17:09:41 +0100 From: Mark Brown To: Xie Yisheng Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, Yisheng Xie , Mark Brown , linux-kernel@vger.kernel.org, Yisheng Xie , alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , andy.shevchenko@gmail.com, Mark Brown , alsa-devel@alsa-project.org Subject: Applied "ASoC: max98095: use match_string() helper" to the asoc tree In-Reply-To: <1527765086-19873-18-git-send-email-xieyisheng1@huawei.com> Message-Id: Date: Thu, 31 May 2018 17:09:41 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: max98095: use match_string() helper has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 1567062f17284637519d004ecc5d7ea0d6c754c3 Mon Sep 17 00:00:00 2001 From: Xie Yisheng Date: Thu, 31 May 2018 19:11:22 +0800 Subject: [PATCH] ASoC: max98095: use match_string() helper match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Yisheng Xie Signed-off-by: Mark Brown --- sound/soc/codecs/max98095.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 6bf2d0ba864f..3b3a10da7f40 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -1634,15 +1634,12 @@ static const char *bq_mode_name[] = {"Biquad1 Mode", "Biquad2 Mode"}; static int max98095_get_bq_channel(struct snd_soc_component *component, const char *name) { - int i; - - for (i = 0; i < ARRAY_SIZE(bq_mode_name); i++) - if (strcmp(name, bq_mode_name[i]) == 0) - return i; + int ret; - /* Shouldn't happen */ - dev_err(component->dev, "Bad biquad channel name '%s'\n", name); - return -EINVAL; + ret = match_string(bq_mode_name, ARRAY_SIZE(bq_mode_name), name); + if (ret < 0) + dev_err(component->dev, "Bad biquad channel name '%s'\n", name); + return ret; } static int max98095_put_bq_enum(struct snd_kcontrol *kcontrol, -- 2.17.0