public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Uwe Bugla <uwe.bugla@gmx.de>, Takashi Iwai <tiwai@suse.de>,
	Len Brown <len.brown@intel.com>, Andrew Morton <akpm@osdl.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/3] PNP: cleanup pnp_fixup_device()
Date: Tue, 06 May 2008 03:08:09 +0200	[thread overview]
Message-ID: <481FAF79.2030407@keyaccess.nl> (raw)

[-- 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);
 	}
 }



             reply	other threads:[~2008-05-06  1:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06  1:08 Rene Herman [this message]
2008-05-06  1:14 ` [PATCH 1/3] PNP: cleanup pnp_fixup_device() Rene Herman
2008-05-06 17:15 ` Bjorn Helgaas
2008-05-10 21:48   ` Rene Herman
     [not found]   ` <482614B3.4000908@gmail.com>
2008-05-10 21:48     ` [PATCH 2/3] PNP: add pnp_build_option() to the API Rene Herman
2008-05-10 21:48     ` [PATCH 3/3] PNP: add ISAPnP MPU option quirks Rene Herman
2008-05-10 21:56       ` Rene Herman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=481FAF79.2030407@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=akpm@osdl.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    --cc=uwe.bugla@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox