Skip to contentSkip to conversation

tools: Delete the initialization value

PATCH In review shijm 2 participants 4 messages Aug 25, 2022 – Sep 3, 2022

Subsystems (2)
lore
Share & tools
lore

shijm

author
#0 lore raw

PATCH 1/1 tools: Delete the initialization value

From: Shi junming <[email protected]>

From the perspective of commpier,delete the initialization value

---
 tools/power/acpi/tools/pfrut/pfrut.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/acpi/tools/pfrut/pfrut.c +1 -1
index d79c335594b2..52aa0351533c 100644
@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
 	void *addr_map_capsule;
 	struct stat st;
 	char *log_buf;
-	int ret = 0;
+	int ret;
 
 	if (getuid() != 0) {
 		printf("Please run the tool as root - Exiting.\n");
Signature · 1 line
2.18.2
#1 lore raw
Quoted 4 lines · shijm

From: Shi junming <junming(a)nfschina.com>

From the perspective of commpier,delete the initialization value

I'm not sure what this means.

The initialization is unnecessary, because the variable in question is always assigned a new value before reading it. Is that what you wanted to say?

Quoted 21 lines
Signed-off-by Shi junming <junming(a)nfschina.com>
---
 tools/power/acpi/tools/pfrut/pfrut.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/acpi/tools/pfrut/pfrut.c +1 -2
index d79c335594b2..52aa0351533c 100644
@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
        void *addr_map_capsule;
        struct stat st;
        char *log_buf;
-       int ret = 0;
+       int ret;
 
        if (getuid() != 0) {
                printf("Please run the tool as root - Exiting.\n");
--

2.18.2

#3 lore raw
Quoted 2 lines · shijm

yes,just your said!

OK

I've applied the patch as 6.1 material under a new subject and with a new changelog.

Thanks!