From: Jesper Juhl <jesper.juhl@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: lxie@us.ibm.com, Andrew Morton <akpm@osdl.org>,
Jesper Juhl <jesper.juhl@gmail.com>,
greg@kroah.com
Subject: [PATCH] Reduce nr of ptr derefs in drivers/pci/hotplug/rpaphp_pci.c
Date: Sun, 11 Dec 2005 06:42:38 +0100 [thread overview]
Message-ID: <200512110642.38672.jesper.juhl@gmail.com> (raw)
Here's a small patch to reduce the nr. of pointer dereferences in
drivers/pci/hotplug/rpaphp_pci.c
Benefits:
- micro speed optimization due to fewer pointer derefs
- generated code should be slightly smaller
- better readability
note: due to lack of both hardware and cross-compile tools this patch is,
unfortunately, completely untested.
Please review and consider for inclusion.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
drivers/pci/hotplug/rpaphp_pci.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
--- linux-2.6.15-rc5-git1-orig/drivers/pci/hotplug/rpaphp_pci.c 2005-12-04 18:48:04.000000000 +0100
+++ linux-2.6.15-rc5-git1/drivers/pci/hotplug/rpaphp_pci.c 2005-12-11 03:59:31.000000000 +0100
@@ -370,13 +370,14 @@ EXPORT_SYMBOL_GPL(rpaphp_unconfig_pci_ad
static int setup_pci_hotplug_slot_info(struct slot *slot)
{
+ struct hotplug_slot_info *hotplug_slot_info = slot->hotplug_slot->info;
+
dbg("%s Initilize the PCI slot's hotplug->info structure ...\n",
__FUNCTION__);
- rpaphp_get_power_status(slot, &slot->hotplug_slot->info->power_status);
+ rpaphp_get_power_status(slot, &hotplug_slot_info->power_status);
rpaphp_get_pci_adapter_status(slot, 1,
- &slot->hotplug_slot->info->
- adapter_status);
- if (slot->hotplug_slot->info->adapter_status == NOT_VALID) {
+ &hotplug_slot_info->adapter_status);
+ if (hotplug_slot_info->adapter_status == NOT_VALID) {
err("%s: NOT_VALID: skip dn->full_name=%s\n",
__FUNCTION__, slot->dn->full_name);
return -EINVAL;
reply other threads:[~2005-12-11 5:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200512110642.38672.jesper.juhl@gmail.com \
--to=jesper.juhl@gmail.com \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lxie@us.ibm.com \
/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