All of lore.kernel.org
 help / color / mirror / Atom feed
* nvmet: Return PTR_ERR_OR_ZERO in a single line
       [not found] ` <20190430081251epcms2p8ca90db5f46bb9211a80822dde4771640@epcms2p8>
@ 2019-04-30 10:25   ` hch
  0 siblings, 0 replies; only message in thread
From: hch @ 2019-04-30 10:25 UTC (permalink / raw)


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..

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-30 10:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20190430081251epcms2p8ca90db5f46bb9211a80822dde4771640@epcms2p8>
     [not found] ` <20190430081251epcms2p8ca90db5f46bb9211a80822dde4771640@epcms2p8>
2019-04-30 10:25   ` nvmet: Return PTR_ERR_OR_ZERO in a single line hch

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.