kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] ocfs2: remove redundant assignment to variable status
@ 2024-04-23 22:30 Colin Ian King
  2024-04-24  1:40 ` Heming Zhao
  2024-04-24  3:30 ` Joseph Qi
  0 siblings, 2 replies; 4+ messages in thread
From: Colin Ian King @ 2024-04-23 22:30 UTC (permalink / raw)
  To: Mark Fasheh, Joel Becker, Joseph Qi, Heming Zhao, ocfs2-devel
  Cc: kernel-janitors, linux-kernel

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]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/ocfs2/dlm/dlmdomain.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 2e0a2f338282..2018501b2249 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -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) {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH][next] ocfs2: remove redundant assignment to variable status
  2024-04-23 22:30 [PATCH][next] ocfs2: remove redundant assignment to variable status Colin Ian King
@ 2024-04-24  1:40 ` Heming Zhao
  2024-04-24  5:54   ` Dan Carpenter
  2024-04-24  3:30 ` Joseph Qi
  1 sibling, 1 reply; 4+ messages in thread
From: Heming Zhao @ 2024-04-24  1:40 UTC (permalink / raw)
  To: Colin Ian King, Mark Fasheh, Joel Becker, Joseph Qi
  Cc: kernel-janitors, ocfs2-devel

On 4/24/24 06:30, Colin Ian King wrote:
> 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]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   fs/ocfs2/dlm/dlmdomain.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
> index 2e0a2f338282..2018501b2249 100644
> --- a/fs/ocfs2/dlm/dlmdomain.c
> +++ b/fs/ocfs2/dlm/dlmdomain.c
> @@ -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 linux-kernel@vger.kernel.org, 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][next] ocfs2: remove redundant assignment to variable status
  2024-04-23 22:30 [PATCH][next] ocfs2: remove redundant assignment to variable status Colin Ian King
  2024-04-24  1:40 ` Heming Zhao
@ 2024-04-24  3:30 ` Joseph Qi
  1 sibling, 0 replies; 4+ messages in thread
From: Joseph Qi @ 2024-04-24  3:30 UTC (permalink / raw)
  To: Colin Ian King, akpm
  Cc: kernel-janitors, linux-kernel, ocfs2-devel, Mark Fasheh,
	Joel Becker, Heming Zhao



On 4/24/24 6:30 AM, Colin Ian King wrote:
> 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]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/dlm/dlmdomain.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
> index 2e0a2f338282..2018501b2249 100644
> --- a/fs/ocfs2/dlm/dlmdomain.c
> +++ b/fs/ocfs2/dlm/dlmdomain.c
> @@ -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) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][next] ocfs2: remove redundant assignment to variable status
  2024-04-24  1:40 ` Heming Zhao
@ 2024-04-24  5:54   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2024-04-24  5:54 UTC (permalink / raw)
  To: Heming Zhao
  Cc: Colin Ian King, Mark Fasheh, Joel Becker, Joseph Qi,
	kernel-janitors, ocfs2-devel

On Wed, Apr 24, 2024 at 09:40:33AM +0800, Heming Zhao wrote:
> On 4/24/24 06:30, Colin Ian King wrote:
> > 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]
> > 
> > Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> > ---
> >   fs/ocfs2/dlm/dlmdomain.c | 1 -
> >   1 file changed, 1 deletion(-)
> > 
> > diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
> > index 2e0a2f338282..2018501b2249 100644
> > --- a/fs/ocfs2/dlm/dlmdomain.c
> > +++ b/fs/ocfs2/dlm/dlmdomain.c
> > @@ -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 linux-kernel@vger.kernel.org, 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-24  5:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 22:30 [PATCH][next] ocfs2: remove redundant assignment to variable status Colin Ian King
2024-04-24  1:40 ` Heming Zhao
2024-04-24  5:54   ` Dan Carpenter
2024-04-24  3:30 ` Joseph Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).