lkml.org 
[lkml]   [2021]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] serial: 8250_pci: Replace custom pci_match_id() implementation
On Tue, Oct 26, 2021 at 04:25:58PM +0300, Andy Shevchenko wrote:
> On Tue, Oct 26, 2021 at 08:45:48PM +0800, kernel test robot wrote:

> > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386

> > >> drivers/tty/serial/8250/8250_pci.c:1268:6: warning: variable 'amcc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> > if (match)
> > ^~~~~
> > drivers/tty/serial/8250/8250_pci.c:1273:6: note: uninitialized use occurs here
> > if (amcc) {
> > ^~~~
> > drivers/tty/serial/8250/8250_pci.c:1268:2: note: remove the 'if' if its condition is always true
> > if (match)
> > ^~~~~~~~~~
> > drivers/tty/serial/8250/8250_pci.c:1265:11: note: initialize the variable 'amcc' to silence this warning
> > bool amcc;
> > ^
> > = 0
>
> Clang gives a right and wrong advice at the same time.
> Thank you for the uninitialized case, but variable is boolean, what's 0 here?
>
> I'll send a fix ASAP.

Hmm... GCC haven't showed anything here.
In any case, v3 has just been sent out.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-10-26 15:36    [W:0.039 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site