Skip to contentSkip to conversation

gcc-plugins: structleak: remove unneeded variable 'ret'

PATCH Applied Jason Yan 2 participants 2 messages Apr 18, 2020 – Mar 3, 2021 Gcc plugins

lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 gcc-plugins: structleak: remove unneeded variable 'ret'

Fix the following coccicheck warning:

scripts/gcc-plugins/structleak_plugin.c:177:14-17: Unneeded variable:
"ret". Return "0" on line 207

---
 scripts/gcc-plugins/structleak_plugin.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
scripts/gcc-plugins/structleak_plugin.c +1 -2
index e89be8f5c859..fdff6278eda0 100644
@@ -174,7 +174,6 @@ static void initialize(tree var)
 static unsigned int structleak_execute(void)
 {
 	basic_block bb;
-	unsigned int ret = 0;
 	tree var;
 	unsigned int i;
 
@@ -204,7 +203,7 @@ static unsigned int structleak_execute(void)
 			initialize(var);
 	}
 
-	return ret;
+	return 0;
 }
 
 #define PASS_NAME structleak
Signature · 1 line
2.21.1
Applied
#1 lore raw
Quoted 4 lines · Jason Yan

Fix the following coccicheck warning:

scripts/gcc-plugins/structleak_plugin.c:177:14-17: Unneeded variable:
"ret". Return "0" on line 207

Applied to for-next/gcc-plugins, thanks!

[1/1] gcc-plugins: structleak: remove unneeded variable 'ret'

      https://git.kernel.org/kees/c/b924a8197ac7
Signature · 1 line
Kees Cook