From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9C74C2BB85 for ; Mon, 13 Apr 2020 03:16:46 +0000 (UTC) Received: from vger.kernel.org (unknown [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79E20206DA for ; Mon, 13 Apr 2020 03:16:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rN69rysV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79E20206DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728525AbgDMDQo (ORCPT ); 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-Google-Smtp-Source: APiQypItGHPXPnsy1S/7ewXviLIp7ovweo1JzQvp+pRla6x2SM0Xc5ae+Mid29m10MeNtKBNayczigkmHxXihCVcmM0= 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9EF7C2BA19 for ; Mon, 13 Apr 2020 03:17:51 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07B10206DA for ; Mon, 13 Apr 2020 03:17:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Ws6W6QR6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rN69rysV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07B10206DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 35C7C16C1; Mon, 13 Apr 2020 05:16:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 35C7C16C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1586747869; bh=dvse0COOrsfgfoczcCmGwHBjJaJmXMkMzR4XwPPgeKQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ws6W6QR6zB40ZhGP/lziZlD+QBV79Ss7DuQ5SnhNHchJfxzNRopxDeGkCWos+w6iq 5pA7llGdiLF8EnHbi4rMjREaM7kaL3Mm2sYwj7CjgETcvz2ajyhRJKvnOTy517lgMW GbvD9cIA6dfpsyP7KQfTwl3hDptxqFg9upO1af/E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CBFBDF80229; Mon, 13 Apr 2020 05:16:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 54444F80245; Mon, 13 Apr 2020 05:16:55 +0200 (CEST) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 89F89F80115 for ; Mon, 13 Apr 2020 05:16:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 89F89F80115 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rN69rysV" Received: by mail-qk1-x741.google.com with SMTP id m67so8210492qke.12 for ; Sun, 12 Apr 2020 20:16:45 -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=pghOr4yhsV0t7IifjFCYzbhyNrDD7SnQ8+6S0kGvPASv3SPCDdYLO4sjk+sgJXibEP +fKVkKz988ApwMoBME4D1ezBKwtcwZKXhdUftNQDN5X/II/425aaj5kzHknHev/c7OxH r2xlWjNzduJkxFljMG5w26OhittH7VUg1x+js5qlxcswplY9eckm4dZHwAzMnb0jpFf5 4Nu7BoFvXP7j22Fx8pV2GPbVB2b5uRndjxjhdELU5KITnPtkRlRpEoyjqUDbsFn+uEak HE5oETPdFGResUQ5uc2GM/Vjdt7mhXqEe2YPzrlTyzX6jIcKgBMbBtLeltqyzfiS7fZ+ 2uEA== X-Gm-Message-State: AGi0PuazNI/lDQlsjbjcG0xeagWhSTe80/4VTnlRwJnoSHtyXmuJa/vn BgWo/BCMGgD/Wqk6FHGcHZ8H+a7yNF+H63kT1h8= X-Google-Smtp-Source: APiQypItGHPXPnsy1S/7ewXviLIp7ovweo1JzQvp+pRla6x2SM0Xc5ae+Mid29m10MeNtKBNayczigkmHxXihCVcmM0= 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 Content-Type: text/plain; charset="UTF-8" Cc: Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-ALSA , Timur Tabi , Xiubo Li , Fabio Estevam , Shengjiu Wang , Takashi Iwai , Liam Girdwood , Rob Herring , Mark Brown , linuxppc-dev@lists.ozlabs.org, linux-kernel X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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