Skip to contentSkip to conversation

ocfs2: remove redundant assignment to variable status

PATCH Applied Colin Ian King 4 participants 4 messages Apr 23, 2024 – Apr 24, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: remove redundant assignment to variable status

Variable status is being assigned and error code that is never read, it is being assigned inside of a do-while loop. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
fs/ocfs2/dlm/dlmdomain.c:1530:2: warning: Value stored to 'status' is never read [deadcode.DeadStores]

---
 fs/ocfs2/dlm/dlmdomain.c | 1 -
 1 file changed, 1 deletion(-)
fs/ocfs2/dlm/dlmdomain.c +0 -1
index 2e0a2f338282..2018501b2249 100644
@@ -1527,7 +1527,6 @@ static void dlm_send_join_asserts(struct dlm_ctxt *dlm,
 {
 	int status, node, live;
 
-	status = 0;
 	node = -1;
 	while ((node = find_next_bit(node_map, O2NM_MAX_NODES,
 				     node + 1)) < O2NM_MAX_NODES) {
Signature · 1 line
2.39.2
reviewer
#1 lore raw
Quoted 18 lines · Colin Ian King

Variable status is being assigned and error code that is never read, it is being assigned inside of a do-while loop. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
fs/ocfs2/dlm/dlmdomain.c:1530:2: warning: Value stored to 'status' is never read [deadcode.DeadStores]

---
  fs/ocfs2/dlm/dlmdomain.c | 1 -
  1 file changed, 1 deletion(-)
fs/ocfs2/dlm/dlmdomain.c +0 -0
index 2e0a2f338282..2018501b2249 100644

fs/ocfs2/dlm/dlmdomain.c static void dlm_send_join_asserts(struct dlm_ctxt *dlm, · line 1532

Quoted 7 lines
fs/ocfs2/dlm/dlmdomain.c +0 -1
@@ -1527,7 +1527,6 @@ static void dlm_send_join_asserts(struct dlm_ctxt *dlm,
  {
  	int status, node, live;
 
-	status = 0;
  	node = -1;
  	while ((node = find_next_bit(node_map, O2NM_MAX_NODES,
  				     node + 1)) < O2NM_MAX_NODES) {

This mail cc [email protected], it would be better to only cc ocfs2-devel next time.

This patch is correct, but it's a very trivial fix. I am not sure if Joseph is willing to take time to push to mainline kernel.

Thanks,
Heming

#2 lore raw
Quoted 14 lines · Heming Zhao
Quoted 13 lines · Colin Ian King

Variable status is being assigned and error code that is never read, it is being assigned inside of a do-while loop. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
fs/ocfs2/dlm/dlmdomain.c:1530:2: warning: Value stored to 'status' is never read [deadcode.DeadStores]

---
  fs/ocfs2/dlm/dlmdomain.c | 1 -
  1 file changed, 1 deletion(-)
Quoted 14 lines

fs/ocfs2/dlm/dlmdomain.c static void dlm_send_join_asserts(struct dlm_ctxt *dlm, · line 1531

Quoted 11 lines
fs/ocfs2/dlm/dlmdomain.c +0 -1
index 2e0a2f338282..2018501b2249 100644
@@ -1527,7 +1527,6 @@ static void dlm_send_join_asserts(struct dlm_ctxt *dlm,
  {
  	int status, node, live;
-	status = 0;
  	node = -1;
  	while ((node = find_next_bit(node_map, O2NM_MAX_NODES,
  				     node + 1)) < O2NM_MAX_NODES) {

This mail cc [email protected], it would be better to only cc ocfs2-devel next time.

I used to tell people that, but Linus Torvalds disagreed with me. I also used to filter LKML from my own patches but then I ran into the issue where a couple subsystems use LKML as a source for patchwork and they get annoyed when it's not on the CC list. In one of the threads for last year's kernel summit people said you should just use get_maintainer.pl and keep LKML on the CC list. So I think that is the rule now.

Except for maybe in networking. I still edit the CC lists there.

regards,
dan carpenter

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Colin Ian King
Quoted 9 lines · Colin Ian King

Variable status is being assigned and error code that is never read, it is being assigned inside of a do-while loop. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
fs/ocfs2/dlm/dlmdomain.c:1530:2: warning: Value stored to 'status' is never read [deadcode.DeadStores]

Quoted 16 lines
---
 fs/ocfs2/dlm/dlmdomain.c | 1 -
 1 file changed, 1 deletion(-)
fs/ocfs2/dlm/dlmdomain.c +0 -1
index 2e0a2f338282..2018501b2249 100644
@@ -1527,7 +1527,6 @@ static void dlm_send_join_asserts(struct dlm_ctxt *dlm,
 {
 	int status, node, live;
 
-	status = 0;
 	node = -1;
 	while ((node = find_next_bit(node_map, O2NM_MAX_NODES,
 				     node + 1)) < O2NM_MAX_NODES) {