Re: [PATCH] mmc: fix card block compile warnings

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

 



On Thu, Mar 22, 2012 at 11:58 AM, Ulf Hansson
<ulf.hansson@xxxxxxxxxxxxxx> wrote:
> On 03/22/2012 08:35 AM, Linus Walleij wrote:

>> -       unsigned int from, nr, arg;
>> +       unsigned int uninitialized_var(from);
>> +       unsigned int uninitialized_var(nr);
>> +       unsigned int uninitialized_var(arg);
>>        int err = 0, type = MMC_BLK_SECDISCARD;
>>
>>        if (!(mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))) {
>
>
> Is not the problem only related to the arg variable?

Nope the compiler complains about all three...

> What about:
>        unsigned int from, nr, arg = 0;

That also works, but we had a previous patch with that approach
NACKed in the past, the reason was that the problem does not
appear in x86 GCC, just in ARM GCC which is more sensitive.
(commit 8c320c079cde0286d71368961231e426539868b4)

By reading the code you can easily see that the variables aren't
actually used uninitialized, it's juts GCC that is unable to
follow the code path and determine that they are initialized in
all paths.

But assigning zero is fine with me, Chris may decide...

Thanks,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux