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 15:02:43 -0800
Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> wrote:

> On Friday, January 9, 2009 1:53 pm Andrew Morton wrote:
> > 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_re
> > > >sume 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.
> 
> aerdrv_core.c:report_resume from my fairly recent Linus tree (came from 
> b0b801dd7de3d77bb143d3c98199b487df0fc63a apparently):
> 
> 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 ||
>                 !dev->driver->err_handler ||
>                 !dev->driver->err_handler->resume)
>                 return;
> 
>         err_handler = dev->driver->err_handler;
>         err_handler->resume(dev);
>         return;
> }
> 
> What bits are you looking at?

Seem that my local tree got scrogged.

Sigh.  We seem to have more than the usual amouint of crap going
on at present.

> > 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);
> > }
> 
> Yeah the indentation is pretty messed up, but other than that it doesn't seem 
> much less readable than your version; I'm happy to take a patch though. :)

It's about removing the amount of pointer chasing..
--
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