Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1275332ybb; Fri, 10 Apr 2020 22:51:15 -0700 (PDT) X-Google-Smtp-Source: APiQypIhSRW3nNzFJZvFxYzqe9hMkRmVHg6BnV+/sjzJUbLDIDeFIrbf8G/kC+U85IBilkiayj8J X-Received: by 2002:ae9:f30f:: with SMTP id p15mr7152006qkg.178.1586584275796; Fri, 10 Apr 2020 22:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586584275; cv=none; d=google.com; s=arc-20160816; b=jv31QmXTR+G2MdTXNBWkOc+Ts4yVbdDFEtXU04N+OAdH/1hQLeiHCiM++9zlYZBT3+ eMW7itMacQaOS76pZfl8AkkalJN+8na+rfMAn+THcgtPvG0e6xnepGJ4m1gSLErkJYN5 Ng3MHczjnFr5DkuyVcgt7hoMEhJyQqCg2r8o6AF+zobwJy25huzGkwxuT1HbsPVjDnu8 Qi/74D4Ov1hPiBwAAlPcq3p/jR0xuFa44pS7spiCeZKzsSzRrg/uXa8gVq28W7OYsyvD yxqjm4T8XBowTE7hcrjw6VlOx84E2IQ8hOBaMb+T1qaw3DkHwrLc7M1hzKaLxxXVuUTf QxFw== 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 :in-reply-to:references:mime-version:dkim-signature; bh=UJrtFPh2k7Ocn2F2h4jgSLlpNWoMCuHTn40DR2631os=; b=DxvQv8xTtmXvHU5RQHOAgijEm1e5Fh1CdTvcNJdyN4MB/mLMcHCtclNZ5Q3A8eZju6 LxuAYgMrDdJg4fLtk7v1tJiO7OKtvjklcV4+VgacP5R73xduoeWJ3jTfXcPb3i6PA6dE L2qcx6nQVOBrJNDrLv1rYqh7YAeMCfRwJcSAknTmRUS9cFhQ6PYtqAMjGFGibAEe6gmV XiUnDKOaeUC+b5Uw0zXvTyiYLbxjwiOQXsxOBSdEljD4xX+rSAKZKSWb8UOSWxLirokW 4Lue56XK/vO8q2+iNacpftzWUnZ5TuU/fJB2ma4TXrJczniLLESBhCEW9NSkAGVJbO0V 10ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q5aneZKK; 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 z11si2594083qkl.265.2020.04.10.22.51.00; Fri, 10 Apr 2020 22:51:15 -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=q5aneZKK; 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 S1726025AbgDKFt5 (ORCPT + 99 others); Sat, 11 Apr 2020 01:49:57 -0400 Received: from mail-qv1-f67.google.com ([209.85.219.67]:38361 "EHLO mail-qv1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbgDKFt5 (ORCPT ); Sat, 11 Apr 2020 01:49:57 -0400 Received: by mail-qv1-f67.google.com with SMTP id p60so1942754qva.5; Fri, 10 Apr 2020 22:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UJrtFPh2k7Ocn2F2h4jgSLlpNWoMCuHTn40DR2631os=; b=q5aneZKKA78xQ6o1kJ1rScGZMZivPxz9JT4IiA4AblcWrlcRjvjh6cpnmwnS62vv1T bEbtqMxoHQvxkLa8HHlRwa3jMgYPeNd/k/3r9FuIGLgF0li7N2q7/0bUM8SSWLn3NE1U Sh9VJhTkn84Wrr87C5rn69nla076gFroH9YBa/4+skYdmR+O380EnUnRCbREX4jQKHiO 0NXSGQXZv5jP6nMOdq3WowIdE0WqqKGcY5OOGEMtgqcYVBklvd2oZ19bMWyt+TdLtNg9 XZQbPs3z2fUy1Z+BidU3rnDt+GzWSSMIddxLw8EkUI9Exn9cRvtHi2azMDuvotyBa/Bk mkjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UJrtFPh2k7Ocn2F2h4jgSLlpNWoMCuHTn40DR2631os=; b=aZ/dL+TlZ2j8z5Kuj36/d/nK9k08Sqi4LZ6E0XwYPSNKxt2GznuDCM8jxNDgWzQyU1 ceTlv1GrliIaL24tObtycE5bcmhhW+z7TZp0uyq8t9h8RjEoHEYPnnxV4p0DbwK9KcNX obPx9wAQ8NlizBX4z3QwwtcAb2xYHBn0wNoVeBG1us1WGARxfP9iOWTet93HxCUkVGPv BaCHETHVyPv8GMsVapBHmQswkwwd7s7Mw9iGqh90N7TUYaYCsOhQAjIFe3Wz9EZOFHtR 1NcKUjCiRqpWLWFVPuyzaesGU/X7EpcewfqhGg3uC1cEVCFdTmvyNCRSy27S6FMvion3 Be/A== X-Gm-Message-State: AGi0PuY1AFeuc7EU5UCw6geDZOmMT9CEeePRJsuJeg53+nws1PRcf7wq HIx19U3lesGefo6+G9EBQc0fN9QyQddTv8XEyUl+wGMKf8A= X-Received: by 2002:ad4:4665:: with SMTP id z5mr8411234qvv.32.1586584194833; Fri, 10 Apr 2020 22:49:54 -0700 (PDT) MIME-Version: 1.0 References: <93531963f028aabf9176173de3c6038a200acb89.1585726761.git.shengjiu.wang@nxp.com> <20200406234819.GB20945@Asurada-Nvidia.nvidia.com> In-Reply-To: <20200406234819.GB20945@Asurada-Nvidia.nvidia.com> From: Shengjiu Wang Date: Sat, 11 Apr 2020 13:49:43 +0800 Message-ID: Subject: Re: [PATCH v6 5/7] ASoC: fsl_asrc: Move common definition to fsl_asrc_common To: Nicolin Chen Cc: Shengjiu Wang , Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-ALSA , Timur Tabi , Xiubo Li , linuxppc-dev@lists.ozlabs.org, Takashi Iwai , Liam Girdwood , Rob Herring , Mark Brown , Fabio Estevam , linux-kernel 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 Hi On Tue, Apr 7, 2020 at 7:50 AM Nicolin Chen wrote: > > On Wed, Apr 01, 2020 at 04:45:38PM +0800, Shengjiu Wang wrote: > > > static int fsl_asrc_probe(struct platform_device *pdev) > > { > > struct device_node *np = pdev->dev.of_node; > > struct fsl_asrc *asrc; > > + struct fsl_asrc_priv *asrc_priv; > > Could we move it before "struct fsl_asrc *asrc;"? > > > diff --git a/sound/soc/fsl/fsl_asrc_common.h b/sound/soc/fsl/fsl_asrc_common.h > > new file mode 100644 > > index 000000000000..5c93ccdfc30a > > --- /dev/null > > +++ b/sound/soc/fsl/fsl_asrc_common.h > > > +#define PAIR_CTX_NUM 0x4 > > +#define PAIR_PRIVAT_SIZE 0x400 > > "PRIVAT_" => "PRIVATE_" > > > +/** > > + * fsl_asrc_pair: ASRC common data > > "fsl_asrc_pair" => "fsl_asrc" > > > + */ > > +struct fsl_asrc { > > > diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c > > index b15946e03380..5cf0468ce6e3 100644 > > --- a/sound/soc/fsl/fsl_asrc_dma.c > > +++ b/sound/soc/fsl/fsl_asrc_dma.c > > > @@ -311,11 +311,12 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component, > > return ret; > > } > > > > - pair = kzalloc(sizeof(struct fsl_asrc_pair), GFP_KERNEL); > > + pair = kzalloc(sizeof(struct fsl_asrc_pair) + PAIR_PRIVAT_SIZE, GFP_KERNEL); > > If we only use the PAIR_PRIVATE_SIZE here, maybe we can put the > define in this file too, rather than in the header file. > > And could fit 80 characters: > > + pair = kzalloc(sizeof(*pair) + PAIR_PRIVAT_SIZE, GFP_KERNEL); I will use a function pointer int (*get_pair_priv_size)(void) to avoid definition of PAIR_PRIVATE_SIZE. which is not safe. best regards wang shengjiu