[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200805061115.56737.bjorn.helgaas@hp.com>
Date: Tue, 6 May 2008 11:15:56 -0600
From: Bjorn Helgaas <bjorn.helgaas@...com>
To: Rene Herman <rene.herman@...access.nl>
Cc: Uwe Bugla <uwe.bugla@....de>, Takashi Iwai <tiwai@...e.de>,
Len Brown <len.brown@...el.com>, Andrew Morton <akpm@...l.org>,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] PNP: cleanup pnp_fixup_device()
On Monday 05 May 2008 07:08:09 pm Rene Herman wrote:
[It's easier to comment if the patch is inline rather than attached.]
> PNP: cleanup pnp_fixup_device()
>
> Signed-off-by: Rene Herman <rene.herman@...il.com>
>
> diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
> index 3f2d34a..10b1295 100644
> --- a/drivers/pnp/quirks.c
> +++ b/drivers/pnp/quirks.c
> @@ -209,20 +209,12 @@ static struct pnp_fixup pnp_fixups[] = {
>
> void pnp_fixup_device(struct pnp_dev *dev)
> {
> - int i = 0;
> - void (*quirk)(struct pnp_dev *);
> -
> - while (*pnp_fixups[i].id) {
> - if (compare_pnp_id(dev->id, pnp_fixups[i].id)) {
> - quirk = pnp_fixups[i].quirk_function;
> -
> -#ifdef DEBUG
> - dev_dbg(&dev->dev, "calling quirk 0x%p", quirk);
> - print_fn_descriptor_symbol(": %s()\n",
> - (unsigned long) *quirk);
> -#endif
> - (*quirk)(dev);
> - }
> - i++;
> + int i;
> +
> + for (i = 0; *pnp_fixups[i].id; i++) {
> + if (!compare_pnp_id(dev->id, pnp_fixups[i].id))
> + continue;
> + dev_dbg(&dev->dev, "calling quirk for %s\n", pnp_fixups[i].id);
> + pnp_fixups[i].quirk_function(dev);
> }
> }
I'm sort of attached to keeping this similar to pci_do_fixups()
and keeping the symbol, even though the #ifdef is ugly. I do
like getting rid of the "0x%p" and adding the PNP ID.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists