Re: [patch 3/5] aerdrv: fix sanity check in report_resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 9 Jan 2009 13:41:03 -0800
Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> wrote:

> On Friday, January 9, 2009 12:26 pm akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> > From: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>
> >
> > What we have to check here before calling that err_handler->resume is
> > non-NULL.  It seems that this block has been copy&pasted from
> > report_slot_reset.
> >
> > Signed-off-by: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>
> > Acked-by: "Zhang, Yanmin" <yanmin.zhang@xxxxxxxxx>
> > Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> > ---
> >
> >  drivers/pci/pcie/aer/aerdrv_core.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff -puN
> > drivers/pci/pcie/aer/aerdrv_core.c~aerdrv-fix-sanity-check-in-report_resume
> > drivers/pci/pcie/aer/aerdrv_core.c ---
> > a/drivers/pci/pcie/aer/aerdrv_core.c~aerdrv-fix-sanity-check-in-report_resu
> >me +++ a/drivers/pci/pcie/aer/aerdrv_core.c
> > @@ -252,7 +252,7 @@ static void report_resume(struct pci_dev
> >
> >  	if (!dev->driver ||
> >  		!dev->driver->err_handler ||
> > -		!dev->driver->err_handler->slot_reset)
> > +		!dev->driver->err_handler->resume)
> >  		return;
> >
> >  	err_handler = dev->driver->err_handler;
> > _
> 
> This one is already upstream afaict.

I can't see it anywhere.

It's not coded particularly nicely.  How's about this?

static void report_resume(struct pci_dev *dev, void *data)
{
	struct pci_error_handlers *err_handler;

	dev->error_state = pci_channel_io_normal;

	if (!dev->driver)
		return;
	err_handler = dev->driver->err_handler;
	if (!err_handler)
		return;
	if (!err_handler->resume)
		return;
	err_handler->resume(dev);
}

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux