linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawn.guo@freescale.com (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] ARM: imx: Use PTR_ERR_OR_ZERO in platform-mxc_rnga.c
Date: Thu, 29 May 2014 16:03:22 +0800	[thread overview]
Message-ID: <20140529080321.GF8860@dragon> (raw)
In-Reply-To: <1401339434-26085-1-git-send-email-sachin.kamat@linaro.org>

On Thu, May 29, 2014 at 10:27:10AM +0530, Sachin Kamat wrote:
> PTR_ERR_OR_ZERO simplifies the code.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  arch/arm/mach-imx/devices/platform-mxc_rnga.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/devices/platform-mxc_rnga.c b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
> index c58404badb59..33d58ca2001a 100644
> --- a/arch/arm/mach-imx/devices/platform-mxc_rnga.c
> +++ b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
> @@ -6,6 +6,7 @@
>   * the terms of the GNU General Public License version 2 as published by the
>   * Free Software Foundation.
>   */
> +#include <linux/err.h>
>  #include "../hardware.h"
>  #include "devices-common.h"
>  
> @@ -48,9 +49,6 @@ static int __init imxXX_add_mxc_rnga(void)
>  #endif /* if defined(CONFIG_SOC_IMX31) */
>  		ret = ERR_PTR(-ENODEV);
>  
> -	if (IS_ERR(ret))
> -		return PTR_ERR(ret);
> -
> -	return 0;
> +	return PTR_ERR_OR_ZERO(ret);

The existing code looks just fine and actually more readable to me.
Also, all the files you are patching will eventually be killed by DT
support.  So let's just leave it there as it is for now.

Shawn

>  }
>  arch_initcall(imxXX_add_mxc_rnga);
> -- 
> 1.7.9.5
> 

  parent reply	other threads:[~2014-05-29  8:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29  4:57 [PATCH 1/5] ARM: imx: Use PTR_ERR_OR_ZERO in platform-mxc_rnga.c Sachin Kamat
2014-05-29  4:57 ` [PATCH 2/5] ARM: imx: Use PTR_ERR_OR_ZERO in mach-mx31moboard.c Sachin Kamat
2014-05-29  4:57 ` [PATCH 3/5] ARM: imx: Use PTR_ERR_OR_ZERO in mx31moboard-devboard.c Sachin Kamat
2014-05-29  4:57 ` [PATCH 4/5] ARM: imx: Use PTR_ERR_OR_ZERO in mx31moboard-marxbot.c Sachin Kamat
2014-05-29  4:57 ` [PATCH 5/5] ARM: imx: Use PTR_ERR_OR_ZERO in mx31moboard-smartbot.c Sachin Kamat
2014-05-29  8:03 ` Shawn Guo [this message]
2014-05-29  8:06   ` [PATCH 1/5] ARM: imx: Use PTR_ERR_OR_ZERO in platform-mxc_rnga.c Sachin Kamat
2014-06-02 17:18   ` Philippe Rétornaz

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=20140529080321.GF8860@dragon \
    --to=shawn.guo@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).