All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Fabio Estevam <festevam@gmail.com>, broonie@kernel.org
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	alsa-devel@alsa-project.org, timur@tabi.org
Subject: Re: [PATCH 2/2] ASoC: fsl_dma: Do not use 'full_name' node reference
Date: Wed, 07 Jan 2015 18:26:45 +0100	[thread overview]
Message-ID: <54AD6C55.7030600@metafoo.de> (raw)
In-Reply-To: <1420651312-21671-2-git-send-email-festevam@gmail.com>

On 01/07/2015 06:21 PM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> The only usage of 'full_name' is inside an error message, which provides a
> rather verbose node path.
>
> A more concise error message can be obtained by using 'pdev->name' instead.

It's probably best to drop it altogether in that case. dev_err() already 
prints the name of the device.

  It
> also makes the kzalloc calculation simpler, as we don't need to take the length
> of full_name into account.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Buit tested only.
>
>   sound/soc/fsl/fsl_dma.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
> index 026da0a..770de20 100644
> --- a/sound/soc/fsl/fsl_dma.c
> +++ b/sound/soc/fsl/fsl_dma.c
> @@ -897,12 +897,12 @@ static int fsl_soc_dma_probe(struct platform_device *pdev)
>   	ret = of_address_to_resource(ssi_np, 0, &res);
>   	if (ret) {
>   		dev_err(&pdev->dev, "could not determine resources for %s\n",
> -			ssi_np->full_name);
> +			pdev->name);
>   		of_node_put(ssi_np);
>   		return ret;
>   	}
>
> -	dma = kzalloc(sizeof(*dma) + strlen(np->full_name), GFP_KERNEL);
> +	dma = kzalloc(sizeof(*dma), GFP_KERNEL);

This should probably be part of patch 1.

>   	if (!dma) {
>   		dev_err(&pdev->dev, "could not allocate dma object\n");
>   		of_node_put(ssi_np);
>

  parent reply	other threads:[~2015-01-07 17:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07 17:21 [PATCH 1/2] ASoC: fsl_dma: Remove 'path' field from dma_object struct Fabio Estevam
2015-01-07 17:21 ` [PATCH 2/2] ASoC: fsl_dma: Do not use 'full_name' node reference Fabio Estevam
2015-01-07 17:26   ` Timur Tabi
2015-01-07 17:26   ` Lars-Peter Clausen [this message]
2015-01-07 17:27     ` Timur Tabi
2015-01-07 17:47       ` Fabio Estevam
2015-01-07 17:54         ` Timur Tabi
2015-01-07 17:23 ` [PATCH 1/2] ASoC: fsl_dma: Remove 'path' field from dma_object struct Timur Tabi

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=54AD6C55.7030600@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@freescale.com \
    --cc=festevam@gmail.com \
    --cc=timur@tabi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.