Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp835406imm; Mon, 21 May 2018 15:26:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo5L3w7KyDjCoeSBqG7NvsZyyK77aSWzctD+/iSNF4KtvlPuh7RhI7cINmzCdWZqZpglD1m X-Received: by 2002:a17:902:14b:: with SMTP id 69-v6mr22408045plb.184.1526941571239; Mon, 21 May 2018 15:26:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526941571; cv=none; d=google.com; s=arc-20160816; b=HXYZrL7snrL1UeRIsD/73e0WLQ40qYxTeemvDcj4oVTlpTVGfloqwM7pHoTLpf3hwh eWyKG3FMZ+ZEL7mLda4VBYACxSwFM2eSAFzqIibZyaNi+3Hs/+ydzoOPqng52+PIzoqQ KfunLjZwDh9b/E02PduFrwwMy6RXE7xxSVlqKkoC4fU1l69Opby3CcqJybl0fzIxiVgl a656HgRDs7QQQ03HEw/jXqeipB4rvA6pJjLzGL5Z5K86wjKuMMPx8lFw4seGAH6BM5QE lJHslEo3EqYcsImhuB7EIV4SuHtIyHgJWzxveMz+0yJqMAZKvPjSQK4mwk/bfGLRWsFs 1mdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ajfYY6DbIHfslUztj6hBXTZc9ABNuSko54Zx8BnhpPE=; b=jrKlVLDVeSYyTKurqmUn6hh6M7RUYgndMYbo0FARy4ozZG27fAyX/JebB0uYtx5zke v2DN5kEDlAlUV/mlwwIP5YVZ89bVN0cmM9/oGbRC9lEBxXKMR865Qi8gwplP9IDHxtZN 5/0Y7Oi+GJBwmqe/L+RGf4JH0riY9UEiANxAsCIs19obE9+USGmQsxSXgYlkHfvx8KDY q16sn8xZNi0yrwTOf2FsofFfNbFfofR5QETy/XcntRFPG9qMSPstOD6NDRO8ygeJB3V+ FKEOPGcA4iOQLbiVn56Bi097i1UTtVfaVtt+fZ0BUuHQ4c4SnjruM5IX9g0Fhky0wVk1 nM+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MoTr0nep; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3-v6si1387680pgq.287.2018.05.21.15.25.56; Mon, 21 May 2018 15:26:11 -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=pass header.i=@gmail.com header.s=20161025 header.b=MoTr0nep; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbeEUWYq (ORCPT + 99 others); Mon, 21 May 2018 18:24:46 -0400 Received: from mail-qt0-f173.google.com ([209.85.216.173]:41458 "EHLO mail-qt0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752989AbeEUWYm (ORCPT ); Mon, 21 May 2018 18:24:42 -0400 Received: by mail-qt0-f173.google.com with SMTP id g13-v6so20974761qth.8 for ; Mon, 21 May 2018 15:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ajfYY6DbIHfslUztj6hBXTZc9ABNuSko54Zx8BnhpPE=; b=MoTr0nep77oE0Ck2OV+YyvG76CH9iDCEeeevdqkcrEPaRysavEm4zcAQN3bW+keNgx IHFlvV5LPqgIbuxDe+2wRtav/JNaM7YFuPoiJqdYXuCOVUBqN5WcYamw+qiRWI0rbofn 1NfeWip0AxQZZ1NuIW5VhlTbO3GOJDcv3T8k5Bv4Gxh7S8ofDfmw3ARTyKvQnyqzv4M7 LpeeFOfYAJhXVLoQBt1AKaMl15dT4TFflmywU9g+xJjNXbujzaaCtrvHFnJGKN96LTKz +pZ4ifRvSec/nF7U2FzbW1J85OuKlRsSilzjF+3J+LEUwCdnZyYr7U5gG2AlZpJl9Iuh RUbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ajfYY6DbIHfslUztj6hBXTZc9ABNuSko54Zx8BnhpPE=; b=lo96tYil0KhjxLF3xFVj/ceAz0zyyv/pJh/jaKVcDIrzb5gGiCbYdf1/WqJLsrcQfG 96mwmuhepnmTJ6XRU9DNMIBg44YQR+X7UHrYNbl2CyZ6Wkj2JXYVno8Ct1MiT0Ny83MF Qeu+QwSKnvnbQwR8nlce4bX5LH4pL6hjWTQsI7cChuj1Lvr8lfUYp3KpUy5TJ2ddNV2O u+4Smk5Cs9Gulo+WYU3CQq/KJ2Jz2kMq2kqsw9lUlpnjkwrOxew8QX/xZjzjayuTwqI4 rH8rBtZBZzjIQ0pW+lqAoBDITQgrQsn/5x+/Sofx1NAMWgKNcHB0XGDgPKPdrNTf0xon RgDQ== X-Gm-Message-State: ALKqPwdt1/7wAzs6fEF+KQdsieRiQn/sjvPdtLCD/SB+3ROS/9F5TxTl ZUNJxRCE0LxkshVwaQ34/cirHRfi3Rdsdd/8j3M= X-Received: by 2002:a0c:f288:: with SMTP id k8-v6mr19414662qvl.14.1526941481833; Mon, 21 May 2018 15:24:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.152.150 with HTTP; Mon, 21 May 2018 15:24:41 -0700 (PDT) In-Reply-To: <1526903890-35761-32-git-send-email-xieyisheng1@huawei.com> References: <1526903890-35761-1-git-send-email-xieyisheng1@huawei.com> <1526903890-35761-32-git-send-email-xieyisheng1@huawei.com> From: Andy Shevchenko Date: Tue, 22 May 2018 01:24:41 +0300 Message-ID: Subject: Re: [PATCH 31/33] ASoC: max98088: use match_string() helper To: Yisheng Xie Cc: Linux Kernel Mailing List , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , ALSA Development Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 21, 2018 at 2:58 PM, Yisheng Xie wrote: > match_string() returns the index of an array for a matching string, > which can be used intead of open coded variant. > static int max98088_get_channel(struct snd_soc_component *component, const char *name) > { > + int ret = match_string(eq_mode_name, ARRAY_SIZE(eq_mode_name), name); I would rather split this and move an assignment to the line before 'if' > > /* Shouldn't happen */ > + if (ret < 0) > + dev_err(component->dev, "Bad EQ channel name '%s'\n", name); > return -EINVAL; return ret; ? > } > > -- > 1.7.12.4 > -- With Best Regards, Andy Shevchenko