2018-01-28 05:26:41

by Sumit Pundir

[permalink] [raw]
Subject: [PATCH] staging: lustre: lnet: return of an error code should be negative

Return value of error codes should typically be negative.
Issue reported by checkpatch.pl

Signed-off-by: Sumit Pundir <[email protected]>
---
drivers/staging/lustre/lnet/selftest/framework.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index c7697f6..0ca1e3a 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -187,7 +187,7 @@ sfw_del_session_timer(void)
return 0;
}

- return EBUSY; /* racing with sfw_session_expired() */
+ return -EBUSY; /* racing with sfw_session_expired() */
}

static void
--
2.7.4



2018-01-30 01:49:58

by Dilger, Andreas

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: lnet: return of an error code should be negative

On Jan 27, 2018, at 22:24, Sumit Pundir <[email protected]> wrote:
>
> Return value of error codes should typically be negative.
> Issue reported by checkpatch.pl
>
> Signed-off-by: Sumit Pundir <[email protected]>

Reviewed-by: Andreas Dilger <[email protected]>

> ---
> drivers/staging/lustre/lnet/selftest/framework.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
> index c7697f6..0ca1e3a 100644
> --- a/drivers/staging/lustre/lnet/selftest/framework.c
> +++ b/drivers/staging/lustre/lnet/selftest/framework.c
> @@ -187,7 +187,7 @@ sfw_del_session_timer(void)
> return 0;
> }
>
> - return EBUSY; /* racing with sfw_session_expired() */
> + return -EBUSY; /* racing with sfw_session_expired() */
> }
>
> static void
> --
> 2.7.4
>

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation








2018-02-11 21:40:01

by James Simmons

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: lnet: return of an error code should be negative


> Return value of error codes should typically be negative.
> Issue reported by checkpatch.pl
>

Reviewed-by: James Simmons <[email protected]>

> Signed-off-by: Sumit Pundir <[email protected]>
> ---
> drivers/staging/lustre/lnet/selftest/framework.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
> index c7697f6..0ca1e3a 100644
> --- a/drivers/staging/lustre/lnet/selftest/framework.c
> +++ b/drivers/staging/lustre/lnet/selftest/framework.c
> @@ -187,7 +187,7 @@ sfw_del_session_timer(void)
> return 0;
> }
>
> - return EBUSY; /* racing with sfw_session_expired() */
> + return -EBUSY; /* racing with sfw_session_expired() */
> }
>
> static void
> --
> 2.7.4
>
>