Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3159941ybb; Mon, 13 Apr 2020 01:55:39 -0700 (PDT) X-Google-Smtp-Source: APiQypIXeVukAo5lj6ZpczsRP4kKM4363//1YOzSlcw021p9u2EWFxCfaqHDdnS7HhBD3zrz8mhE X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr15229467edv.217.1586768139569; Mon, 13 Apr 2020 01:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586768139; cv=none; d=google.com; s=arc-20160816; b=FD3LwEdmg3Q/7Jlt/0cVvqRx+I4OYqEzVsFDhvVQOTJPT1oZbyJxwtginUjHXogCtn HHXJa6299R2K5bePG1ZEqo8cKS5kynJWmugJbGY3NyORv2Txc2Jr0Pn25t0jpHPXSySl Bl+VVqlp0zpSz61jzitNrmNmYwTGop4aiFQo4UpR3fCmuyZS8PgYePku7JVo2f8i3ICF 4ClR7v6cLZAjtw9zUJY6nSx37qxmHBXzFJlk/ljsI1ZBA/2AB+zRrvOcoCm6G1wrmhNF A302UN0VWJd0hRYMAjESrdl4Nm/cEKfBCHv/kEnWk0TmU/w4mWHM5ntzLiIehvbfrQAK Vfsw== 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=8E/j11TZfH7UZNApZvH4fEyzZjBApgpFuNvhfzAcUS4=; b=O1YYlcFoPoNz87q2yTWpPqDujUs09L5KdaLlYEK2xGRNmbDCamYDJoBf0e0NSMB6Lb lKbT/eVNE1afWzmncotqUXzLpEWqjcJaQ5SKF5Io2lgxgcqYxvEH6TzwQSGY4Convhcn 8feIPpbD4LqCswPG+2sQrv7wlKcn7uWLoxHHhZ1JeWGMo+pV//uCVL4zQ8OOwQy60QaR 8tRMKJm2aTqNmEFCFDBMQZ0yR4lHljDSeucUrGL7XS0pZEtZIE16LHaaUHWK5KowoM+l Fk+in6s6rgmfywP8i0p38F+8O0jJbbvgRMZ04q/bkAE4IrLfSM33kVqlQzxBc5rafQTL 9fyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rN69rysV; 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 b22si6300531ejk.393.2020.04.13.01.55.16; Mon, 13 Apr 2020 01:55:39 -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=rN69rysV; 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 S1728521AbgDMDQo (ORCPT + 99 others); Sun, 12 Apr 2020 23:16:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.18]:48262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728460AbgDMDQn (ORCPT ); Sun, 12 Apr 2020 23:16:43 -0400 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B3FBC0A3BE0; Sun, 12 Apr 2020 20:16:43 -0700 (PDT) Received: by mail-qk1-x744.google.com with SMTP id s63so4092969qke.4; Sun, 12 Apr 2020 20:16:43 -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=8E/j11TZfH7UZNApZvH4fEyzZjBApgpFuNvhfzAcUS4=; b=rN69rysVCPRtDzu9ocDB8luGscQ5EDAzFC2HUPBZoBmnadjkGd12CRKaUx5KCEmflo EjTtB+OZ2lBX7RZXRvyzxIqvKtDx/jgPV82ukKk4l3qRTVFmtWCScuIAIcWvHi+zUDww Cr7BAtYsbLMGPjM0IFFZx87NZcQUYIBsEaRTJDmxyRFWGIvQVX6iAisWS93MSXj07hrA FB3kyYhKxDxDChLwsHTilLFCicvIZSSBv1ehw6yEG2MMLACgwMJp58iqUHb7TfI55Qa4 BVMIvw8KomziBHrkvm29KOnA7a6RWsgHHxhSdNWqrbO+XAg9rtixBd9DVRkw73jbvwkJ 7/lw== 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=8E/j11TZfH7UZNApZvH4fEyzZjBApgpFuNvhfzAcUS4=; b=Y1TvHYcwQFzq8Cui3L+JsfW5EjaBijLupYOfNVzKTy4pVYXldSFyzM6lHucKlwKjDm tIMwRMLtun/gYVC9fZPsmKfkllPWVoimXYJW5wb4QjQInoP0cptwct2qurcRaUavLFc6 O0xcp8KPd/+g5lIUcnKaIL3WGDotO2GI/LbumlSiIqZa6eQN5sVB/gCE64MO4LlS53ll PI79B2mW/NYX/Qh6UgJ8IonCBGC67zGjaCHMNdlqMKOGph6GmLyh5lXH9UG8ckBf0+rh VreVF2+zMW+wqkUil7+DWm0eZiVeTX9q3O82bQu7fGDGMAt6u/EfG+4Aqug9t/Uwny2C cBNw== X-Gm-Message-State: AGi0PuZj9U52AQGsPJPws3NsVd7pHnNNU/6PMb/u26+pie5iNC33krEI jcUGd789n2w9S8icBGr4NUZw/T3UQ4Gfa5asbOY= X-Received: by 2002:a37:4fd0:: with SMTP id d199mr14522999qkb.121.1586747802796; Sun, 12 Apr 2020 20:16:42 -0700 (PDT) MIME-Version: 1.0 References: <93531963f028aabf9176173de3c6038a200acb89.1585726761.git.shengjiu.wang@nxp.com> <20200406234819.GB20945@Asurada-Nvidia.nvidia.com> <20200412020814.GA5984@Asurada> In-Reply-To: <20200412020814.GA5984@Asurada> From: Shengjiu Wang Date: Mon, 13 Apr 2020 11:16:31 +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 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)" best regards wang shengjiu