Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4456123yba; Wed, 17 Apr 2019 11:53:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3WMgBfxHVmGL3pcwxnqaljkA+UIeQNbA9JcP3ioeRbmIu964MKD2rR1DEsVRtXkAucTXz X-Received: by 2002:a63:2a8f:: with SMTP id q137mr82585853pgq.31.1555527230336; Wed, 17 Apr 2019 11:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555527230; cv=none; d=google.com; s=arc-20160816; b=xBnAsbmxem/HauxE3zqDdI8GhBiXK+VzVISG3VIdtvEKk5+Wos+V8KDtlo0Y3/0r0j CfAtyKmIyyMbFGt2bkaPPesDDeD1IsnxrZbsvv2o68C2kmxI05bsfflSIIlFbLW1/Yn+ QcrZtJheaG1i5gWN3sFf7Z72ntYyicw5xg+bl1YvAJCBhqXHXaCNGTVS22tkRhatOqRv 4QqNWF5ffbQax2uQhdKwqczxWJoXE4BPsTDMWw9inXgWO9qfh18GFQMYgmQ7u4niXboy AdpmNUpg+Teun7O/RVcyA6sZTjq/IiBCSgOA6YEZPrJiHBZV3xFlLO8pz+SpQnZt9l7R 0Ycw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HJHPz+R+CU544kFQAxOjPvxjaUk0WljUZxgaPbvIzcc=; b=rXWkEFdhE27CIR0PYHHR1O6kz1kXF/CV/jTF9kXMQmNkUU5XgA0B8y6bYsNiJsLZ4G tQruFxnsDI1FYox6a9QfFdiU3ftDn2mibleE9hJUoZem7A6BI+pSIWar5kD0CnJw6R5c IP9KkclNmbvfQnkLtPYlE4G/rr9VBfCk4Cd42dYRiQiQc2zPKMJ9GDIRQO8nzoStATlV txw+4klHPA4odH8HgDRR6D3gJH+D5nwJ2YZpY5XEnOp9+D3RkwotpW3TJXodji3J8gDN 8gzn22FaBC6oIjdPSVeLCM/zhaw32j/C6mPZaYkmJEdPUjtfrjN739oyFwiayS2ypyXf yjuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YqfWBwrm; 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 k185si52603244pgc.450.2019.04.17.11.53.33; Wed, 17 Apr 2019 11:53:50 -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=YqfWBwrm; 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 S1731806AbfDQSwk (ORCPT + 99 others); Wed, 17 Apr 2019 14:52:40 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42259 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727340AbfDQSwk (ORCPT ); Wed, 17 Apr 2019 14:52:40 -0400 Received: by mail-pg1-f196.google.com with SMTP id p6so12406358pgh.9 for ; Wed, 17 Apr 2019 11:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HJHPz+R+CU544kFQAxOjPvxjaUk0WljUZxgaPbvIzcc=; b=YqfWBwrmfbl5Hv+1kfO451IuZw6K2fopkKRxOjVMmlqLtvfCD+8P8ulQ5lZgK/1Yuo wotciWLK1N9YFaKqnCC7KhDsWaBYCcT1dWVmNfqTTBO+DZ/5zjovCURXwfjLc4pQbepd VYPgFROhVk0Kz2SB9pI7EgoAvlIvb4aJVn2gBesvQmz74RGyw98dVBk0ZR4it8OA+gFO 1vAu6X2c1JHJk0vVLXC27yg0uqDAWYDzdVGAfYoi6j8YgTrYpToOSc/dvRAfaZhyVRNC HlTYWRVSM1S292BTrmgfIvsUpIXINuwXvCLc9+m4MBwzQa93AZ+/J9BjehizbkejOG45 tAvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HJHPz+R+CU544kFQAxOjPvxjaUk0WljUZxgaPbvIzcc=; b=eRYJv7hcc2EixQvFWiZCfHM2osy+pDvrMFBzXLZswWOduvbnSwwzyUXy2Qu4izpmwJ DElw/hsVpGI0Sp8xrbkNYtMVVRsB5aHrpQIWnGQru6tIylfuapUeIEXULH/dB5sOVzQ0 Pd0Trbxp04VRcbDBS4hu08LgYm0GuEE0tlzrxELU35fghvoCwaa1FF0NPhCm2sVLzzDT uoXGxUslVDjqbDadgDYrT6bRlPfN8wCV0r/dSndc5IpaRzSv48vEg8admGYzZaAhnSbv M52ypBJDqDUh1I8jwRCctCWZwb240E89wqBgiufmMh5fiCrEuWmDrFAge+X70Y0hYnz5 tg5A== X-Gm-Message-State: APjAAAXxp4QNBhcrTUEoHjURtBdaOb3Y838ToczlenVDBSFwR7s7Up8N B1ojU+EMoDTlJ9Ey4aX9bQlG/WzUqeI= X-Received: by 2002:a63:2158:: with SMTP id s24mr38059731pgm.156.1555527159561; Wed, 17 Apr 2019 11:52:39 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id g5sm42888832pfo.53.2019.04.17.11.52.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Apr 2019 11:52:39 -0700 (PDT) Date: Wed, 17 Apr 2019 11:52:36 -0700 From: Nicolin Chen To: "S.j. Wang" Cc: "timur@kernel.org" , "Xiubo.Lee@gmail.com" , "festevam@gmail.com" , "broonie@kernel.org" , "alsa-devel@alsa-project.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V3 1/2] ASoC: fsl_asrc: replace the process_option table with function Message-ID: <20190417185236.GC5073@Asurada-Nvidia.nvidia.com> References: <1eaeb882bdd69108c8ce897398c5c36ece6d49c5.1555491598.git.shengjiu.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1eaeb882bdd69108c8ce897398c5c36ece6d49c5.1555491598.git.shengjiu.wang@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shengjiu, This looks better. Just a couple of more small comments inline. On Wed, Apr 17, 2019 at 09:06:18AM +0000, S.j. Wang wrote: > +static int fsl_asrc_sel_proc(int inrate, int outrate, int *pre_proc, > + int *post_proc) Just a nit: it looks better by grouping them two-two. static int fsl_asrc_sel_proc(int inrate, int outrate, int *pre_proc, int *post_proc) > + /* Condition for selection of post-processing */ > + post_proc_cond2 = (inrate * 15 > outrate * 16 && outrate < 56000) || > + (inrate > 56000 && outrate < 56000); Could align the indentation: post_proc_cond2 = (inrate * 15 > outrate * 16 && outrate < 56000) || (inrate > 56000 && outrate < 56000); Here: > + /* Does not support cases: Tsout > 8.125 * Tsin */ > + if (inrate * 8 > 65 * outrate) > + return -EINVAL; And here: > + ret = fsl_asrc_sel_proc(inrate, outrate, &pre_proc, &post_proc); > + if (ret) { > + pair_err("No supported pre-processing options\n"); > + return ret; > + } Instead of a general message, I was thinking of a more specific one by telling users that the ratio between the two rates isn't supported -- something similar to what I suggested previously: pair_err("Does not support %d (input) > 8.125 * %d (output)\n", outrate, inrate); Thanks Nicolin