public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	linux390@de.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arch: s390: mm: Use PTR_RET function
Date: Wed, 13 Mar 2013 19:10:34 +0000	[thread overview]
Message-ID: <20130313191034.GM21522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1363201557-17715-1-git-send-email-gheorghiuandru@gmail.com>

On Wed, Mar 13, 2013 at 09:05:57PM +0200, Alexandru Gheorghiu wrote:
> Used PTR_RET function instead of IS_ERR and PTR_ERR.
> Patch found using coccinelle.
> 
> Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
> ---
>  arch/s390/mm/cmm.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
> index 479e942..5cf867f 100644
> --- a/arch/s390/mm/cmm.c
> +++ b/arch/s390/mm/cmm.c
> @@ -458,7 +458,7 @@ static int __init cmm_init(void)
>  	if (rc)
>  		goto out_pm;
>  	cmm_thread_ptr = kthread_run(cmm_thread, NULL, "cmmthread");
> -	rc = IS_ERR(cmm_thread_ptr) ? PTR_ERR(cmm_thread_ptr) : 0;
> +	rc = PTR_RET(cmm_thread_ptr);
>  	if (rc)
>  		goto out_kthread;
>  	return 0;

Egads...  How about
	if (!IS_ERR(cmm_thread_ptr))
		return 0;
	rc = PTR_ERR(cmm_thread_ptr);
instead of the entire thing?  out_kthread: is just past that return 0
and there's nothing else leading to it, so with that change the label
itself can go as well.

      reply	other threads:[~2013-03-13 19:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13 19:05 [PATCH] arch: s390: mm: Use PTR_RET function Alexandru Gheorghiu
2013-03-13 19:10 ` Al Viro [this message]

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=20130313191034.GM21522@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=gheorghiuandru@gmail.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=schwidefsky@de.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox