Re: [PATCH] PnP update - drivers

From: Linus Torvalds (torvalds@transmeta.com)
Date: Mon Jan 13 2003 - 17:58:40 EST


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:

> -/* 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.

                Linus

-
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/



This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:47 EST