All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Jean Pihet <jean.pihet@newoldbits.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Paul Walmsley <paul@pwsan.com>, Jean Pihet <j-pihet@ti.com>
Subject: Re: [PATCH] ARM: OMAP3+: PM debug: fix the use of debugfs_create_* API
Date: Tue, 31 Jan 2012 09:44:10 -0800	[thread overview]
Message-ID: <87ehufojh1.fsf@ti.com> (raw)
In-Reply-To: <1328008819-1110-1-git-send-email-j-pihet@ti.com> (Jean Pihet's message of "Tue, 31 Jan 2012 12:20:19 +0100")

Jean Pihet <jean.pihet@newoldbits.com> writes:

> The debugfs_create_* API returns a NULL ptr in case of problem.
> Fix the PM debug code to take this into account.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  arch/arm/mach-omap2/pm-debug.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
> index 4411163..e5bf367 100644
> --- a/arch/arm/mach-omap2/pm-debug.c
> +++ b/arch/arm/mach-omap2/pm-debug.c
> @@ -264,8 +264,8 @@ static int __init pm_dbg_init(void)
>  		return 0;
>  
>  	d = debugfs_create_dir("pm_debug", NULL);
> -	if (IS_ERR(d))
> -		return PTR_ERR(d);
> +	if (!d)

I think this should be IS_ERR_OR_NULL() because this function can also
return ERR_PTR(-ENODEV).  (Yes, only when debugfs is not enabled, but
it's still more correct.)

Kevin

> +		return -ENOMEM;
>  	(void) debugfs_create_file("count", S_IRUGO,
>  		d, (void *)DEBUG_FILE_COUNTERS, &debug_fops);

WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP3+: PM debug: fix the use of debugfs_create_* API
Date: Tue, 31 Jan 2012 09:44:10 -0800	[thread overview]
Message-ID: <87ehufojh1.fsf@ti.com> (raw)
In-Reply-To: <1328008819-1110-1-git-send-email-j-pihet@ti.com> (Jean Pihet's message of "Tue, 31 Jan 2012 12:20:19 +0100")

Jean Pihet <jean.pihet@newoldbits.com> writes:

> The debugfs_create_* API returns a NULL ptr in case of problem.
> Fix the PM debug code to take this into account.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  arch/arm/mach-omap2/pm-debug.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
> index 4411163..e5bf367 100644
> --- a/arch/arm/mach-omap2/pm-debug.c
> +++ b/arch/arm/mach-omap2/pm-debug.c
> @@ -264,8 +264,8 @@ static int __init pm_dbg_init(void)
>  		return 0;
>  
>  	d = debugfs_create_dir("pm_debug", NULL);
> -	if (IS_ERR(d))
> -		return PTR_ERR(d);
> +	if (!d)

I think this should be IS_ERR_OR_NULL() because this function can also
return ERR_PTR(-ENODEV).  (Yes, only when debugfs is not enabled, but
it's still more correct.)

Kevin

> +		return -ENOMEM;
>  	(void) debugfs_create_file("count", S_IRUGO,
>  		d, (void *)DEBUG_FILE_COUNTERS, &debug_fops);

  reply	other threads:[~2012-01-31 17:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 11:20 [PATCH] ARM: OMAP3+: PM debug: fix the use of debugfs_create_* API Jean Pihet
2012-01-31 11:20 ` Jean Pihet
2012-01-31 17:44 ` Kevin Hilman [this message]
2012-01-31 17:44   ` Kevin Hilman
2012-02-01  8:34   ` Jean Pihet
2012-02-01  8:34     ` Jean Pihet
2012-02-01  8:37 ` [PATCH] ARM: OMAP2+: " Jean Pihet
2012-02-01  8:37   ` Jean Pihet
2012-02-01 17:37   ` Kevin Hilman
2012-02-01 17:37     ` Kevin Hilman

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=87ehufojh1.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=j-pihet@ti.com \
    --cc=jean.pihet@newoldbits.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    /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.