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 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.

Attachment: signature.asc
Description: Digital signature


[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