/drivers/acpi/acpica/nsrepair.c (2.6.35.7) - Fixed useless compile warning
Subsystems (2)
PATCH 1/1 /drivers/acpi/acpica/nsrepair.c (2.6.35.7) - Fixed useless compile warning
This is not a problem, it is a simple fix for an ugly compiler warning. When I tried to cimpile, I got the following warning:drivers/acpi/acpica/nsrepair.c: In function ‘acpi_ns_repair_object’:drivers/acpi/acpica/nsrepair.c:125:29: warning: ‘new_object’ may be used uninitialized in this functionnew_object is declared without being initialized. It is initialized in a conditional expression like if (expected_btypes & ACPI_RTYPE_INTEGER) so the compiler can't be sure that it will be used initialized, and it throws that warning.
Just have to initialize new_object which is a pointer with NULL. Patch:
---
drivers/acpi/acpica/nsrepair.c 2010-09-20 08:00:40.000000000 +0300 renamed from drivers/acpi/acpica/nsrepair.c 2010-09-20 08:35:56.568006487 +0300 +1 -1
@@ -122,7 +122,7 @@ acpi_ns_repair_object(struct acpi_predef union acpi_operand_object **return_object_ptr) { union acpi_operand_object *return_object = *return_object_ptr; - union acpi_operand_object *new_object; + union acpi_operand_object *new_object = NULL; acpi_status status; ACPI_FUNCTION_NAME(ns_repair_object);
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Len Brown
reviewerthanks,
Len Brown, Intel Open Source Technology Center
Quoted 10 lines · Poyo VL
This is not a problem, it is a simple fix for an ugly compiler warning. When I tried to cimpile, I got the following warning:
drivers/acpi/acpica/nsrepair.c: In function ‘acpi_ns_repair_object’:drivers/acpi/acpica/nsrepair.c:125:29: warning: ‘new_object’ may be used uninitialized in this functionnew_objectis declared without being initialized. It is initialized in a conditional expression like if (expected_btypes&ACPI_RTYPE_INTEGER) so the compiler can't be sure that it will be used initialized, and it throws that warning.
Just have to initializenew_objectwhich is a pointer with NULL.
I don't see this warning.
What version of the compiler are you using?
thanks,
-Len
Quoted 17 lines
Patch:
Signed-off-by Ionut Gabriel Popescu <[email protected]>---
drivers/acpi/acpica/nsrepair.c 2010-09-20 08:00:40.000000000 +0300 renamed from drivers/acpi/acpica/nsrepair.c 2010-09-20 08:35:56.568006487 +0300 +1
-1@@ -122,7 +122,7 @@ acpi_ns_repair_object(struct acpi_predef union acpi_operand_object **return_object_ptr) { union acpi_operand_object *return_object = *return_object_ptr; - union acpi_operand_object *new_object; + union acpi_operand_object *new_object = NULL; acpi_status status; ACPI_FUNCTION_NAME(ns_repair_object);
Yes, do tell. Compiler and options used.
We don't see a warning on any of the compilers we test with, nor lint.
Thanks,
Bob
Quoted 54 lines
-----Original Message-----
From: Len Brown [mailto:[email protected]]
Sent: Thursday, September 30, 2010 11:14 PM
To: Poyo VL
Cc: [email protected]; Moore, Robert
Subject: Re: [PATCH] /drivers/acpi/acpica/nsrepair.c (2.6.35.7) - Fixed useless compile warningthanks,
Len Brown, Intel Open Source Technology CenterQuoted 1 line · Poyo VL
This is not a problem, it is a simple fix for an ugly compiler warning.
When I
Quoted 6 lines
tried to cimpile, I got the following warning:
drivers/acpi/acpica/nsrepair.c: In function 'acpi_ns_repair_object':drivers/acpi/acpica/nsrepair.c:125:29: warning: 'new_object' may be used uninitialized in this functionnew_objectis declared without being initialized. It is initialized in a conditional expression like if (expected_btypes&ACPI_RTYPE_INTEGER) sothe
Quoted 1 line
compiler can't be sure that it will be used initialized, and it throws
that
Quoted 2 lines
warning.
Just have to initializenew_objectwhich is a pointer with NULL.I don't see this warning.
What version of the compiler are you using?thanks,
-LenQuoted 6 lines
Patch:
Signed-off-by Ionut Gabriel Popescu <[email protected]>---
---
a/drivers/acpi/acpica/nsrepair.c2010-09-20 08:35:56.568006487+0300
Quoted 1 line
+++
b/drivers/acpi/acpica/nsrepair.c2010-09-20 08:00:40.000000000+0300
Quoted 10 lines
drivers/acpi/acpica/nsrepair.c 2010-09-20 08:00:40.000000000 +0300 renamed from drivers/acpi/acpica/nsrepair.c 2010-09-20 08:35:56.568006487 +0300 +1
-1@@ -122,7 +122,7 @@ acpi_ns_repair_object(struct acpi_predef union acpi_operand_object **return_object_ptr) { union acpi_operand_object *return_object = *return_object_ptr; - union acpi_operand_object *new_object; + union acpi_operand_object *new_object = NULL; acpi_status status; ACPI_FUNCTION_NAME(ns_repair_object);
Is there any other information on this?
Quoted 54 lines
-----Original Message-----
From: Len Brown [mailto:[email protected]]
Sent: Thursday, September 30, 2010 11:14 PM
To: Poyo VL
Cc: [email protected]; Moore, Robert
Subject: Re: [PATCH] /drivers/acpi/acpica/nsrepair.c (2.6.35.7) - Fixed useless compile warningthanks,
Len Brown, Intel Open Source Technology CenterQuoted 1 line · Poyo VL
This is not a problem, it is a simple fix for an ugly compiler warning.
When I
Quoted 6 lines
tried to cimpile, I got the following warning:
drivers/acpi/acpica/nsrepair.c: In function 'acpi_ns_repair_object':drivers/acpi/acpica/nsrepair.c:125:29: warning: 'new_object' may be used uninitialized in this functionnew_objectis declared without being initialized. It is initialized in a conditional expression like if (expected_btypes&ACPI_RTYPE_INTEGER) sothe
Quoted 1 line
compiler can't be sure that it will be used initialized, and it throws
that
Quoted 2 lines
warning.
Just have to initializenew_objectwhich is a pointer with NULL.I don't see this warning.
What version of the compiler are you using?thanks,
-LenQuoted 6 lines
Patch:
Signed-off-by Ionut Gabriel Popescu <[email protected]>---
---
a/drivers/acpi/acpica/nsrepair.c2010-09-20 08:35:56.568006487+0300
Quoted 1 line
+++
b/drivers/acpi/acpica/nsrepair.c2010-09-20 08:00:40.000000000+0300
Quoted 10 lines
drivers/acpi/acpica/nsrepair.c 2010-09-20 08:00:40.000000000 +0300 renamed from drivers/acpi/acpica/nsrepair.c 2010-09-20 08:35:56.568006487 +0300 +1
-1@@ -122,7 +122,7 @@ acpi_ns_repair_object(struct acpi_predef union acpi_operand_object **return_object_ptr) { union acpi_operand_object *return_object = *return_object_ptr; - union acpi_operand_object *new_object; + union acpi_operand_object *new_object = NULL; acpi_status status; ACPI_FUNCTION_NAME(ns_repair_object);