diff mbox series

[-next] device-dax: change error code from postive to negative in range_parse

Message ID 20201026110425.136629-1-zhangqilong3@huawei.com
State New
Headers show
Series [-next] device-dax: change error code from postive to negative in range_parse | expand

Commit Message

Zhang Qilong Oct. 26, 2020, 11:04 a.m. UTC
call trace:
	-> mapping_store()
		-> range_parse()
		......
		rc = -ENXIO;

According to context, the error return value of
range_parse should be negative.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/dax/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joao Martins Nov. 13, 2020, 6:07 p.m. UTC | #1
On 10/26/20 11:04 AM, Zhang Qilong wrote:
> call trace:
> 	-> mapping_store()
> 		-> range_parse()
> 		......
> 		rc = -ENXIO;
> 
> According to context, the error return value of
> range_parse should be negative.
> 
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>

Reviewed-by: Joao Martins <joao.m.martins@oracle.com>

> ---
>  drivers/dax/bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
> index 27513d311242..e15a1a7c2853 100644
> --- a/drivers/dax/bus.c
> +++ b/drivers/dax/bus.c
> @@ -1047,7 +1047,7 @@ static ssize_t range_parse(const char *opt, size_t len, struct range *range)
>  {
>  	unsigned long long addr = 0;
>  	char *start, *end, *str;
> -	ssize_t rc = EINVAL;
> +	ssize_t rc = -EINVAL;
>  
>  	str = kstrdup(opt, GFP_KERNEL);
>  	if (!str)
>
diff mbox series

Patch

diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 27513d311242..e15a1a7c2853 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -1047,7 +1047,7 @@  static ssize_t range_parse(const char *opt, size_t len, struct range *range)
 {
 	unsigned long long addr = 0;
 	char *start, *end, *str;
-	ssize_t rc = EINVAL;
+	ssize_t rc = -EINVAL;
 
 	str = kstrdup(opt, GFP_KERNEL);
 	if (!str)