Re: [PATCH 1/2] gpio: amd8111: Convert PCIBIOS_* return codes to errnos

From: Dan Carpenter
Date: Mon May 27 2024 - 10:56:45 EST


On Mon, May 27, 2024 at 05:11:32PM +0300, Ilpo Järvinen wrote:
> On Mon, 27 May 2024, Dan Carpenter wrote:
>
> > On Mon, May 27, 2024 at 04:23:44PM +0300, Ilpo Järvinen wrote:
> > > diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c
> > > index 6f3ded619c8b..3377667a28de 100644
> > > --- a/drivers/gpio/gpio-amd8111.c
> > > +++ b/drivers/gpio/gpio-amd8111.c
> > > @@ -195,8 +195,10 @@ static int __init amd_gpio_init(void)
> > >
> > > found:
> > > err = pci_read_config_dword(pdev, 0x58, &gp.pmbase);
> > > - if (err)
> > > + if (err) {
> > > + err = pcibios_err_to_errno(err);
> >
> > The patch is correct, but is the CC to stable necessary? Is this a real
> > concern?
> >
> > Most callers don't check. Linus Torvalds, once said something to the
> > effect that if your PCI bus starts failing, there isn't anything the
> > operating system can do, so checking is pointless. The only fix is to
> > buy new hardware. There was a hotpluggable PCI back in the day but I
> > don't think it exists any more.
>
> I don't mind if the CC stable isn't there.

I don't mind either way. I was hoping you were going to say it was for
some new hotswap hardware Intel was working on.

Smatch deletes all the failure paths from the pci_read_ functions
because otherwise you end up with a lot of warnings that no one cares
about. Uninitialized variables mostly?

regards,
dan carpenter