Re: [PATCH] misc: suppress build warning

From: Greg Kroah-Hartman
Date: Thu Dec 04 2014 - 11:30:38 EST


On Thu, Dec 04, 2014 at 03:13:00PM +0000, Prabhakar Lad wrote:
> On Thu, Dec 4, 2014 at 2:59 PM, Arnd Bergmann <arnd@xxxxxxxx> wrote:
> > On Thursday 04 December 2014 14:38:30 Lad, Prabhakar wrote:
> >> this patch fixes following build warning:
> >>
> >> drivers/misc/ioc4.c: In function âioc4_probeâ:
> >> drivers/misc/ioc4.c:194:16: warning: âstartâ may be used uninitialized in this function [-Wmaybe-uninitialized]
> >> period = (end - start) /
> >> ^
> >> drivers/misc/ioc4.c:148:11: note: âstartâ was declared here
> >> uint64_t start, end, period;
> >>
> >> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>
> >
> > Please explain why the compiler thinks there is a bug, why you
> > are sure that there isn't, and why you picked '0' as the
> > initialization value.
> >
> Its a false positive, to suppress the warning '0' was picked.

Are you _sure_ it's a false positive? That odd do/while loop looks like
it might just not ever initialize the start variable, are you sure the
logic there is correct?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/