Re: [PATCH] spi: img-spfi: fix kbuild test robot warning

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

 



On Thu, Aug 6, 2015 at 1:28 PM, Mark Brown <broonie@xxxxxxxxxx> wrote:
> On Thu, Aug 06, 2015 at 10:33:01AM +0100, Sifan Naeem wrote:
>> drivers/spi/spi-img-spfi.c: In function 'img_spfi_setup':
>> drivers/spi/spi-img-spfi.c:446: warning: 'ret' may be used
>> uninitialized in this function.
>>
>> Fixes: commit b03ba9e314c1 ("spi: img-spfi: fix multiple calls to request gpio")
>> Signed-off-by: Sifan Naeem <sifan.naeem@xxxxxxxxxx>
>
> This isn't a good commit message:
>
>>  static int img_spfi_setup(struct spi_device *spi)
>>  {
>> -     int ret;
>> +     int ret = -EINVAL;
>
> You're just assigning a return value so that the compiler can't tell if
> we've missed anything, that's often a sign of just papering over the
> cracks without understanding the problem - for example there may be a
> missing else case in some error path that the compiler was trying to
> tell you about where other cleanup is needed.  The changelog should say
> what the problem was and why the change solves it sensibly.

I'll bite...

It's not 100% clear to me -EINVAL is the right value.
Perhaps it should be 0?
Or the check for gpio_is_valid() should be removed?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux