All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (hch@lst.de)
Subject: nvmet: Return PTR_ERR_OR_ZERO in a single line
Date: Tue, 30 Apr 2019 12:25:49 +0200	[thread overview]
Message-ID: <20190430102549.GA19450@lst.de> (raw)
In-Reply-To: <20190430081251epcms2p8ca90db5f46bb9211a80822dde4771640@epcms2p8>

On Tue, Apr 30, 2019@05:12:51PM +0900, Minwoo Im wrote:
> The previous code is not that bad, but it can be a single line to
> return the PTR_ERR or ZERO.
> 
> Reported-by: kbuild test robot <lkp at intel.com>
> Signed-off-by: Minwoo Im <minwoo.im at samsung.com>
> ---
>  drivers/nvme/target/discovery.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c
> index e8e09266bfa5..e3b20f1cb301 100644
> --- a/drivers/nvme/target/discovery.c
> +++ b/drivers/nvme/target/discovery.c
> @@ -372,9 +372,7 @@ int __init nvmet_init_discovery(void)
>  {
>  	nvmet_disc_subsys =
>  		nvmet_subsys_alloc(NVME_DISC_SUBSYS_NAME, NVME_NQN_DISC);
> -	if (IS_ERR(nvmet_disc_subsys))
> -		return PTR_ERR(nvmet_disc_subsys);
> -	return 0;
> +	return PTR_ERR_OR_ZERO(nvmet_disc_subsys);

Honestly, I find the old version much more readable..

           reply	other threads:[~2019-04-30 10:25 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20190430081251epcms2p8ca90db5f46bb9211a80822dde4771640@epcms2p8>]

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=20190430102549.GA19450@lst.de \
    --to=hch@lst.de \
    /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.