public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: "Li.Xiubo@freescale.com" <Li.Xiubo@freescale.com>
Cc: Mark Brown <broonie@kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: Re: [alsa-devel] [PATCH 2/4] ASoC: simple-card: dynamically allocate the DAI link array
Date: Tue, 25 Feb 2014 09:02:49 +0100	[thread overview]
Message-ID: <20140225090249.4e6cace9@armhf> (raw)
In-Reply-To: <397c6a465f424a3eb42ead8f1e55f7d9@BY2PR03MB505.namprd03.prod.outlook.com>

On Mon, 24 Feb 2014 03:32:02 +0000
"Li.Xiubo@freescale.com" <Li.Xiubo@freescale.com> wrote:
> 
> > @@ -20,7 +20,6 @@ struct simple_card_data {
> >  	unsigned int daifmt;
> >  	struct asoc_simple_dai cpu_dai;
> >  	struct asoc_simple_dai codec_dai;
> > -	struct snd_soc_dai_link snd_link;
> >  };
> > 
> >  static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
> > @@ -246,7 +245,9 @@ static int asoc_simple_card_probe(struct platform_device
> > *pdev)
> >  	struct device *dev = &pdev->dev;
> >  	int ret;
> > 
> > -	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> > +	priv = devm_kzalloc(dev,
> > +			sizeof(*priv) + sizeof(*dai_link),
> 
> This is okey for me.
> 
> Well, how about splitting the *priv and *dai_link into two separated
> memory blocks? As we can get the dai-link pointer via priv->snd_card.dai_link
> in other places.
> 
> IMHO, then the code will be much more simplifier and readable.

It is just a simple optimization: less calls to memory allocation and
less code (also, less TLB reload?). I will add more comments.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

  reply	other threads:[~2014-02-25  8:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 15:12 [PATCH 0/4] ASoC: simple-card: DT fix and multi DAI links extension Jean-Francois Moine
2014-02-19 18:07 ` [PATCH 2/4] ASoC: simple-card: dynamically allocate the DAI link array Jean-Francois Moine
2014-02-24  3:32   ` Li.Xiubo
2014-02-25  8:02     ` Jean-Francois Moine [this message]
2014-02-20 17:25 ` [PATCH 1/4] ASoC: simple-card: Fix device node locks Jean-Francois Moine
2014-02-24  2:17   ` Li.Xiubo
2014-02-25  7:30     ` Jean-Francois Moine
2014-02-25 12:42   ` Mark Brown
2014-02-21  8:56 ` [PATCH 3/4] ASoC: simple-card: accept many DAI links Jean-Francois Moine
2014-02-21 11:43 ` [PATCH 4/4] ASoC: simple-card: add DT documentation for multi-DAI links Jean-Francois Moine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140225090249.4e6cace9@armhf \
    --to=moinejf@free.fr \
    --cc=Li.Xiubo@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox