Re: [PATCH 17/25] staging: lustre: libcfs: rename goto label in cfs_cpt_table_print

2018-04-17 Thread Dan Carpenter
> diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c 
> b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
> index ae5ff58..435ee8e 100644
> --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
> +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
> @@ -161,20 +161,20 @@ int cfs_cpt_table_print(struct cfs_cpt_table *cptab, 
> char *buf, int len)
>  
>   for (i = 0; i < cptab->ctb_nparts; i++) {
>   if (len <= 0)
> - goto out;
> + goto err;
>  
>   rc = snprintf(tmp, len, "%d\t:", i);
>   len -= rc;
>  
>   if (len <= 0)
> - goto out;
> + goto err;

Labels should say what the goto does.  In this case, it's a do-nothing
goto with a "forgot to set the error code" bug.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/25] staging: lustre: libcfs: rename goto label in cfs_cpt_table_print

2018-04-15 Thread James Simmons
From: Dmitry Eremin 

Change goto label out to err.

Signed-off-by: Dmitry Eremin 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8703
Reviewed-on: https://review.whamcloud.com/23222
Reviewed-by: Amir Shehata 
Reviewed-by: James Simmons 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c 
b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
index ae5ff58..435ee8e 100644
--- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
+++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
@@ -161,20 +161,20 @@ int cfs_cpt_table_print(struct cfs_cpt_table *cptab, char 
*buf, int len)
 
for (i = 0; i < cptab->ctb_nparts; i++) {
if (len <= 0)
-   goto out;
+   goto err;
 
rc = snprintf(tmp, len, "%d\t:", i);
len -= rc;
 
if (len <= 0)
-   goto out;
+   goto err;
 
tmp += rc;
for_each_cpu(j, cptab->ctb_parts[i].cpt_cpumask) {
rc = snprintf(tmp, len, " %d", j);
len -= rc;
if (len <= 0)
-   goto out;
+   goto err;
tmp += rc;
}
 
@@ -184,7 +184,7 @@ int cfs_cpt_table_print(struct cfs_cpt_table *cptab, char 
*buf, int len)
}
 
rc = 0;
-out:
+err:
if (rc < 0)
return rc;
 
-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel