Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp840253imm; Mon, 21 May 2018 15:31:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqQx2DrEdpusB3JH3H4Sql4ytg+fvadufmVR0rOfK37VfKmVDqTMy+ktUxeCcGlkMlXOpZD X-Received: by 2002:a63:6e8b:: with SMTP id j133-v6mr6770036pgc.91.1526941909850; Mon, 21 May 2018 15:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526941909; cv=none; d=google.com; s=arc-20160816; b=uvgPb6GhjuKcFb+8eL5O0Xp5vZJmN1qA+etffvlLvZIBZDP95FyZ/qojJL5N97OyQF CCGPF3bSWxW5FWSD6crs5v0aInzrUcJllt3U42IrWrkg3RofmA07t8sgyWZTzh352GmL kr2gIqpw3/tyXmg5kgRo9kMSFT/bmcDqe6J4n+zGt7L91GRUQfnGGud784LUPTaF0oS9 rtVN0Q3XKaOvzL3vjgBZHz0SLzpX5LWYSXnHRGOMkX7ZnjfkhUtEM4mpmBc36hZhk8bV yWYhXnS6sa+g7aCDuAljEbc00aiPW7GUWFVB7mZhuBVUJZwaU9hLLqQZDIntN3lUEqlt /YJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=AgRK+jCSxlh8wfVB8sLBkNm8d/3llVwfEy+SKrd9mYU=; b=ZdqUKCy7uXxd1CDbNG/xYTS7uPkL/B0conoGAD2UwzXHjkwmyTaOtSPW8PwlY/nMyn x6FUQjv7SUg/LS2SBk5luNLWDW3smAogVPj11FdH8Y2w6gm+WFEtKAj3VUu4bCkBkb4Z xycgZudWEbjz1HfATShEG9ZX/IHI9Le8z4ijQ6Pasq1RbOO+7/zEpkhKzWS8cYSZTo0z AqxmoCRj5W7+0jU9BkvWgjzogmNIIT16moVChQwgwduyPcjCD9PL1LZZUULLX5oZpDO6 2Gez31dPp3aE7jY8tFzWUOsPO4oMfTtxhrjzPLf2x8Q05sidiWBSyuSdAmkWaxhqjMDp xigQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14-v6si11923803pgs.178.2018.05.21.15.31.35; Mon, 21 May 2018 15:31:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752723AbeEUWb1 (ORCPT + 99 others); Mon, 21 May 2018 18:31:27 -0400 Received: from smtp-proxy002.phy.lolipop.jp ([157.7.104.43]:45067 "EHLO smtp-proxy002.phy.lolipop.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbeEUWbY (ORCPT ); Mon, 21 May 2018 18:31:24 -0400 Received: from smtp-proxy002.phy.lolipop.lan (HELO smtp-proxy002.phy.lolipop.jp) (172.19.44.43) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp-proxy002.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Tue, 22 May 2018 07:31:23 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp-proxy002.phy.lolipop.jp (LOLIPOP-Fsecure); Tue, 22 May 2018 07:31:23 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) Subject: Re: [PATCH 28/33] ALSA: dice use match_string() helper To: Yisheng Xie , linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org, Clemens Ladisch , Takashi Iwai References: <1526903890-35761-1-git-send-email-xieyisheng1@huawei.com> <1526903890-35761-29-git-send-email-xieyisheng1@huawei.com> From: Takashi Sakamoto Message-ID: <856cff99-0350-368e-f6c9-d632839e6c33@sakamocchi.jp> Date: Tue, 22 May 2018 07:31:23 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1526903890-35761-29-git-send-email-xieyisheng1@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On May 21 2018 20:58, Yisheng Xie wrote: > match_string() returns the index of an array for a matching string, > which can be used intead of open coded variant. > > Cc: Clemens Ladisch > Cc: Jaroslav Kysela > Cc: Takashi Iwai > Cc: Takashi Sakamoto > Cc: alsa-devel@alsa-project.org > Signed-off-by: Yisheng Xie > --- > sound/firewire/dice/dice.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) I'm welcome to this change, while in the latest subsystem tree for v4.18 the 'force_to_pcm_support()' local function was removed by my patch[1]. Your patch can be abandon. > diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c > index 96bb01b..0639074 100644 > --- a/sound/firewire/dice/dice.c > +++ b/sound/firewire/dice/dice.c > @@ -35,19 +35,13 @@ static bool force_two_pcm_support(struct fw_unit *unit) > "SAFFIRE_PRO_40_1", > }; > char model[32]; > - unsigned int i; > int err; > > err = fw_csr_string(unit->directory, CSR_MODEL, model, sizeof(model)); > if (err < 0) > return false; > > - for (i = 0; i < ARRAY_SIZE(models); i++) { > - if (strcmp(models[i], model) == 0) > - break; > - } > - > - return i < ARRAY_SIZE(models); > + return match_string(models, ARRAY_SIZE(models), model) >= 0; > } > > static int check_dice_category(struct fw_unit *unit) [1] ALSA: dice: remove local frag of force_two_pcms https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=for-next&id=9c367c01d3d5 Thanks Takashi Sakamoto