RE: [PATCH] /drivers/acpi/acpica/nsrepair.c (2.6.35.7) - Fixed useless compile warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


>-----Original Message-----
>From: Len Brown [mailto:lenb@xxxxxxxxxx]
>Sent: Thursday, September 30, 2010 11:14 PM
>To: Poyo VL
>Cc: linux-acpi@xxxxxxxxxxxxxxx; Moore, Robert
>Subject: Re: [PATCH] /drivers/acpi/acpica/nsrepair.c (2.6.35.7) - Fixed
>useless compile warning
>
>
>
>thanks,
>Len Brown, Intel Open Source Technology Center
>
>On Sun, 19 Sep 2010, Poyo VL wrote:
>
>> 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 function
>> new_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.
>
>I don't see this warning.
>What version of the compiler are you using?
>
>thanks,
>-Len
>
>> Patch:
>>
>> Signed-off-by: Ionut Gabriel Popescu <poyo_vl@xxxxxxxxx>
>> ---
>>
>> --- a/drivers/acpi/acpica/nsrepair.c    2010-09-20 08:35:56.568006487
>+0300
>> +++ b/drivers/acpi/acpica/nsrepair.c    2010-09-20 08:00:40.000000000
>+0300
>> @@ -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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux