All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] PNP: cleanup pnp_fixup_device()
@ 2008-05-06  1:08 Rene Herman
  2008-05-06 17:15 ` Bjorn Helgaas
  0 siblings, 1 reply; 8+ messages in thread
From: Rene Herman @ 2008-05-06  1:08 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Uwe Bugla, Takashi Iwai, Len Brown, Andrew Morton, Linux Kernel

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

Hi Bjorn.

In response to off-list AD181x thread, small cleanup to quirk handling.

Patch 3/3 does the actual work. Mind if I feed this stuff through you? And,
mind this, period? Not wed to it or anything...

Signed-off-by: Rene Herman <rene.herman@gmail.com>


[-- Attachment #2: pnp-cleanup-pnp_fixup_device.diff --]
[-- Type: text/plain, Size: 1067 bytes --]

commit 4ed0cb4cef2b45a257b6d7d6cdc987e3511ddf58
Author: Rene Herman <rene.herman@gmail.com>
Date:   Tue May 6 01:51:47 2008 +0200

    PNP: cleanup pnp_fixup_device()
    
    Signed-off-by: Rene Herman <rene.herman@gmail.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);
 	}
 }



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-05-10 21:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <481FAC37.6090703@keyaccess.nl>
2008-05-06  1:08 ` [PATCH 2/3] PNP: add pnp_build_option() to the API Rene Herman
     [not found] ` <481FAD12.3030409@keyaccess.nl>
2008-05-06  1:08   ` [PATCH 3/3] PNP: add AD1815 and AD1816 quirks Rene Herman
2008-05-06 19:08     ` Bjorn Helgaas
2008-05-06 21:06       ` Rene Herman
2008-05-06 21:27         ` Bjorn Helgaas
2008-05-06 22:01           ` Rene Herman
2008-05-07  2:14         ` Rene Herman
2008-05-06  1:08 [PATCH 1/3] PNP: cleanup pnp_fixup_device() Rene Herman
2008-05-06 17:15 ` Bjorn Helgaas
     [not found]   ` <482614B3.4000908@gmail.com>
2008-05-10 21:48     ` [PATCH 2/3] PNP: add pnp_build_option() to the API Rene Herman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.