linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux] sysctl: Remove redundant ret assignment
@ 2021-12-30  6:36 cgel.zte
  2022-01-11 18:35 ` Luis Chamberlain
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-12-30  6:36 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: Kees Cook, Iurii Zaikin, linux-fsdevel, luo penghao, Zeal Robot

From: luo penghao <luo.penghao@zte.com.cn>

Subsequent if judgments will assign new values to ret, so the
statement here should be deleted

The clang_analyzer complains as follows:

fs/proc/proc_sysctl.c:

Value stored to 'ret' is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
---
 fs/proc/proc_sysctl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 5d66fae..30d74b8 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -1053,7 +1053,6 @@ static int sysctl_follow_link(struct ctl_table_header **phead,
 	struct ctl_dir *dir;
 	int ret;
 
-	ret = 0;
 	spin_lock(&sysctl_lock);
 	root = (*pentry)->data;
 	set = lookup_header_set(root);
-- 
2.15.2



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

* Re: [PATCH linux] sysctl: Remove redundant ret assignment
  2021-12-30  6:36 [PATCH linux] sysctl: Remove redundant ret assignment cgel.zte
@ 2022-01-11 18:35 ` Luis Chamberlain
  0 siblings, 0 replies; 2+ messages in thread
From: Luis Chamberlain @ 2022-01-11 18:35 UTC (permalink / raw)
  To: cgel.zte, Andrew Morton
  Cc: Kees Cook, Iurii Zaikin, linux-fsdevel, luo penghao, Zeal Robot

On Thu, Dec 30, 2021 at 06:36:22AM +0000, cgel.zte@gmail.com wrote:
> From: luo penghao <luo.penghao@zte.com.cn>
> 
> Subsequent if judgments will assign new values to ret, so the
> statement here should be deleted
> 
> The clang_analyzer complains as follows:
> 
> fs/proc/proc_sysctl.c:
> 
> Value stored to 'ret' is never read
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: luo penghao <luo.penghao@zte.com.cn>

Acked-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis

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

end of thread, other threads:[~2022-01-11 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-30  6:36 [PATCH linux] sysctl: Remove redundant ret assignment cgel.zte
2022-01-11 18:35 ` Luis Chamberlain

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).