Re: [PATCH v2 1/2] serial: 8250_pci: Replace custom pci_match_id() implementation

From: Andy Shevchenko
Date: Tue Oct 26 2021 - 09:35:56 EST


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