Re: [PATCH] PnP update - drivers

Zwane Mwaikambo (zwane@holomorphy.com)
Mon, 13 Jan 2003 20:44:10 -0500 (EST)


On Mon, 13 Jan 2003, Linus Torvalds wrote:

>
> On Mon, 13 Jan 2003, Adam Belay wrote:
> >
> > PnP IDE Conversion from Zwane Mwaikambo
>
> This, btw, is _worse_ than the current conversion, as far as I can tell.
> In particular:

I just had a look (and test booted), the current one definitely is better
and less kludgy.

> > -/* Generic initialisation function for ISA PnP IDE interface */
> > +/* Barf bags at the ready! Enough to satisfy IDE core */
> > +static void pnp_to_pci(struct pnp_dev *pnp_dev, struct pci_dev *pci_dev)
> > +{
> > + pci_dev->dev = pnp_dev->dev;
> > + pci_set_drvdata(pci_dev, pnp_get_drvdata(pnp_dev));
> > + pci_dev->irq = DEV_IRQ(pnp_dev, 0);
> > + pci_set_dma_mask(pci_dev, 0x00ffffff);
> > +}
>
> That "pci_dev->dev = pnp_dev->dev" looks totally bletcherous, and does a
> structure copy that potentially copies pointers that simply ARE NOT VALID
> after the copy.
>
> Not good.

Hey, i did offer barf bags ;) I admit, that part is complete bollocks, due
to my bending over for pci_dev.

Zwane

-- 
function.linuxpower.ca

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/