Staging: lustre: Deleted space prohibited between function name and open parenthesis
PATCH 1/2 Staging: lustre: Deleted space prohibited between function name and open parenthesis
WARNING: space prohibited between function name and open parenthesis '(' Remove unnecessary space between function name and opening parenthesis. That was found by running checkpatch
--- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lnet/lnet/lib-ptl.c +1 -1
@@ -899,7 +899,7 @@ int LNetClearLazyPortal(int portal) {struct lnet_portal *ptl; -LIST_HEAD (zombies); +LIST_HEAD (zombies);if (portal <0 || portal >= the_lnet.ln_nportals)return -EINVAL ;
Signature · 1 line
1.8.3.2
PATCH 2/2 Staging: lustre: Remove unnecessary else after return
WARNING: else is not generally useful after a break or return Remove unnecessary else after return. That was found by running checkpatch
--- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/staging/lustre/lnet/lnet/lib-ptl.c +5 -6
@@ -360,13 +360,12 @@ lnet_mt_match_head(struct lnet_match_table *mtable,if (lnet_ptl_is_wildcard (ptl)) {return &mtable->mt_mhash[mbits &LNET_MT_HASH_MASK ]; - }else { -unsigned long hash = mbits + id.nid + id.pid; - -LASSERT (lnet_ptl_is_unique (ptl)); - hash =hash_long (hash,LNET_MT_HASH_BITS ); -return &mtable->mt_mhash[hash]; } +unsigned long hash = mbits + id.nid + id.pid; + +LASSERT (lnet_ptl_is_unique (ptl)); + hash =hash_long (hash,LNET_MT_HASH_BITS ); +return &mtable->mt_mhash[hash]; }int
Signature · 1 line
1.8.3.2
Re: [Outreachy kernel] [PATCH 2/2] Staging: lustre: Remove unnecessary else after return
Quoted 15 lines · Melike Yurtoglu
WARNING: else is not generally useful after a break or return Remove unnecessary else after return. That was found by running checkpatch
Signed-off-by Melike Yurtoglu <[email protected]>--- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)drivers/staging/lustre/lnet/lnet/lib-ptl.c +0
-0@@ -360,13 +360,12 @@ lnet_mt_match_head(struct lnet_match_table *mtable,
drivers/staging/lustre/lnet/lnet/lib-ptl.c lnet_mt_match_head(struct lnet_match_table *mtable, · line 364
Quoted 10 lines
drivers/staging/lustre/lnet/lnet/lib-ptl.c +1
-6if (lnet_ptl_is_wildcard (ptl)) {return &mtable->mt_mhash[mbits &LNET_MT_HASH_MASK ]; - }else { -unsigned long hash = mbits + id.nid + id.pid; - -LASSERT (lnet_ptl_is_unique (ptl)); - hash =hash_long (hash,LNET_MT_HASH_BITS ); -return &mtable->mt_mhash[hash]; } +unsigned long hash = mbits + id.nid + id.pid;
This is not correct. Kernel code only declares variables at the start of a block. If you want to remove the else, then the declaration of this variable has to move to the top of the function.
julia
Quoted 17 lines
drivers/staging/lustre/lnet/lnet/lib-ptl.c +4
-1+ +LASSERT (lnet_ptl_is_unique (ptl)); + hash =hash_long (hash,LNET_MT_HASH_BITS ); +return &mtable->mt_mhash[hash]; }int --1.8.3.2
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424533029-14651-2-git-send-email-aysemelikeyurtoglu%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 14 lines · Melike Yurtoglu
WARNING: space prohibited between function name and open parenthesis '(' Remove unnecessary space between function name and opening parenthesis. That was found by running checkpatch
Signed-off-by Melike Yurtoglu <[email protected]>--- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lnet/lnet/lib-ptl.c +0
-0
drivers/staging/lustre/lnet/lnet/lib-ptl.c int · line 902
Quoted 5 lines
drivers/staging/lustre/lnet/lnet/lib-ptl.c +1
-1@@ -899,7 +899,7 @@ int LNetClearLazyPortal(int portal) {struct lnet_portal *ptl; -LIST_HEAD (zombies); +LIST_HEAD (zombies);
Actually, LIST_HEAD is not a function. It is a macro that declares a variable. It's a little strange with the parentheses, but currently the variable is lined up with the other declared variables.
julia
Quoted 12 lines
drivers/staging/lustre/lnet/lnet/lib-ptl.c +0
-1if (portal <0 || portal >= the_lnet.ln_nportals)return -EINVAL ; --1.8.3.2
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424533029-14651-1-git-send-email-aysemelikeyurtoglu%40gmail.com.
For more options, visit https://groups.google.com/d/optout.