Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3161309ybb; Mon, 13 Apr 2020 01:58:27 -0700 (PDT) X-Google-Smtp-Source: APiQypINL/fAF1jAIOeuNWxGw1id4y9J0/2ShQjcZYo/kA86AlcJy9ZSR3gGNEgQFkvJ5d4AkDAI X-Received: by 2002:a05:6402:1c99:: with SMTP id cy25mr15999281edb.78.1586768306937; Mon, 13 Apr 2020 01:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586768306; cv=none; d=google.com; s=arc-20160816; b=XxtcyK/+ODw/VUkQMqne83Rl53uky/vtWKgmqdWJ/3tLFAiqgthhKopy2DeRWRxgHh gWo/oQVTWu0tiLsWE3OIzvGMpt6GaKmHljv/3nLxF6wKtUsvX4UHpp+h1YCM6pNrPCB8 ufySFtAQ2ZtQzUJJrhHlE2x9EIoLe9n0LXN9KOlKZKfBK11e9VU9x4Ctuj70lXgowQyo YhbmzYHaHlg5NqJ4SywIHmlGgIPXE1n57OpIfQp3o+Ue1frHw+ywEIFU7lrH9F8q4mvR BqtrlUrZx6eKwkR3Qals2vEzYNpKRD6cfZN4sGgwnuqBibGb6fEmEgGIqWRZHYjsLGhs xIUw== 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=cncGDqt7fHMkXaI3l27jxuKAAcyo4TLpPS8jKmBxrB8=; b=dVw34UE3/b0ZNXMg+t1SeLy9SaUdP76UqoMpd5wi7IkDUUlVq52TsRASOvXE+vi72T e8DVX//3/A2cuRFKUfndVTk9Voe9V7ufmhSgZBhhZT9wNJSzRoU9QBeA89/+m6FhHxOc J7s9WOO5k9zsBUaksfKA2vZH7tJRuPHIJ+BEoom8LRE0PUi/bprb92+0MYpYbmjL5ndx DN2SHc8uIFIBeO7VWJIK2ufBPVhv0qzyFcoMkxFXQPYTi8hz5oLhoFwdugEpu636SnXL 1svIRSlHOmjsKuKo7494xht0tqDumW8gUnB5jOfpQflg69wnfbFp6oGrsusWBNxOPSID ym3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eBiubb27; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g11si3734813edn.181.2020.04.13.01.58.04; Mon, 13 Apr 2020 01:58:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eBiubb27; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728716AbgDMEbv (ORCPT + 99 others); Mon, 13 Apr 2020 00:31:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.18]:60532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbgDMEbv (ORCPT ); Mon, 13 Apr 2020 00:31:51 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68237C0A3BE0; Sun, 12 Apr 2020 21:31:50 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id ng8so3381498pjb.2; Sun, 12 Apr 2020 21:31:50 -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=cncGDqt7fHMkXaI3l27jxuKAAcyo4TLpPS8jKmBxrB8=; b=eBiubb27eRyfe+lqxro+fYFl17BREZ/tw3ox6LXKc1U/ONkBvPz2I8GVeROXQJ7wDj 73JzWAIKxOS6cEpL+iXc7cNlFy4hOHVYSpV2w2OIpeUVoVobgJyP9i2q44KFCf+GPyTA GEmZWDuoMpA/fBn/CbKSP/HizQZT8hPsyzwWOuSvUMHbN5NJrtiAmVQlR5zSrtAMfkI8 mJS7YB+LNizev96VgVNzWAlIAP3/zo/zBcFnaNiAITdOTfpSuS931MEfKZxM4IJAtaM1 Ia/LZKRL2Y0qjmSeQ4mOprXlig5OGHKdATdfieX4b1exDKqvz7H5VVd0obql2UrtLT+m Ppsw== 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=cncGDqt7fHMkXaI3l27jxuKAAcyo4TLpPS8jKmBxrB8=; b=n30odw/ahWGR1Vo9rpgfcqrGd+qUzFyc0yNS9eAB+CNMjAiftBH3X70lMuMATcBh8S jnwXKzx9ReGfHeXTZdvyIuoV+fOMLCBvxGX/Vuw4o43A9NQDx+yXv1/yOnKGgGgUuhCH v5AkY3U5ZlpW5KqXLMGrHhbj5AA+tqI3hISqEkAnpBuEXn16M2uOUIGaJOXZlXdqh+pD FqMGLxTc5BTEa7vwuSZMILd2bb/DqexTP/Da7IQF1SdxmOvxhbP0aEJnITcvSk43t7ou uGh1CKhWDR3kwxTHty0meivrawSQX44796/wb86WYff1yi9o0Jj9frlyUwaqroYyLw1k JaDg== X-Gm-Message-State: AGi0PubquyEmuL6frSAtGYafvquUzm5scgABEHt5dFDC3nHgl4pxSRTH 1nrv/C355FDi0UfHJ61fdp4= X-Received: by 2002:a17:902:784c:: with SMTP id e12mr15604537pln.191.1586752309748; Sun, 12 Apr 2020 21:31:49 -0700 (PDT) Received: from Asurada (c-73-162-191-63.hsd1.ca.comcast.net. [73.162.191.63]) by smtp.gmail.com with ESMTPSA id m9sm7546835pff.93.2020.04.12.21.31.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Apr 2020 21:31:49 -0700 (PDT) Date: Sun, 12 Apr 2020 21:31:43 -0700 From: Nicolin Chen To: Shengjiu Wang 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 Subject: Re: [PATCH v6 5/7] ASoC: fsl_asrc: Move common definition to fsl_asrc_common Message-ID: <20200413043143.GA9116@Asurada> References: <93531963f028aabf9176173de3c6038a200acb89.1585726761.git.shengjiu.wang@nxp.com> <20200406234819.GB20945@Asurada-Nvidia.nvidia.com> <20200412020814.GA5984@Asurada> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 13, 2020 at 11:16:31AM +0800, Shengjiu Wang wrote: > On Sun, Apr 12, 2020 at 10:08 AM Nicolin Chen wrote: > > > > On Sat, Apr 11, 2020 at 01:49:43PM +0800, Shengjiu Wang wrote: > > > > > > > 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) > > > > Since it's the size of pair or cts structure, could be just a > > size_t variable? > > Yes, should be "size_t (*get_pair_priv_size)(void)" Does it have to be a function? -- how about this: struct pair { ... size_t private_size; void *private; }; probe/or-somewhere() { ... pair->private = pair_priv; pair->private_size = sizeof(*pair_priv); ... }