From: Sam Ravnborg <sam@ravnborg.org>
To: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andi Kleen <ak@suse.de>, Christoph Lameter <clameter@sgi.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/5] x86_64: get mp_bus_to_node as early v2
Date: Thu, 26 Jul 2007 22:18:15 +0200 [thread overview]
Message-ID: <20070726201815.GB6387@uranus.ravnborg.org> (raw)
In-Reply-To: <86802c440707261305t13bce632r7d82d598b9f8a308@mail.gmail.com>
On Thu, Jul 26, 2007 at 01:05:09PM -0700, Yinghai Lu wrote:
>
+#ifdef CONFIG_ACPI_NUMA
int pxm;
-
- /* Allocate per-root-bus (not per bus) arch-specific data.
- * TODO: leak; this memory is never freed.
- * It's arguable whether it's worth the trouble to care.
- */
- sd = kzalloc(sizeof(*sd), GFP_KERNEL);
- if (!sd) {
- printk(KERN_ERR "PCI: OOM, not probing PCI bus %02x\n", busnum);
- return NULL;
- }
+ int node;
+#endif
if (domain != 0) {
printk(KERN_WARNING "PCI: Multiple domains not supported\n");
- kfree(sd);
return NULL;
}
- sd->node = -1;
-
- pxm = acpi_get_pxm(device->handle);
#ifdef CONFIG_ACPI_NUMA
- if (pxm >= 0)
- sd->node = pxm_to_node(pxm);
+ pxm = acpi_get_pxm(device->handle);
+ if (pxm >= 0) {
+ node = pxm_to_node(pxm);
+ printk(KERN_INFO "bus %02x -> pxm %d -> node %02x\n",
+ busnum, pxm, node);
+ set_mp_bus_to_node(busnum, node);
+ }
#endif
The local variable 'node' is only used in the above if statement.
So moving the definition inside the if statement will save one pair
of ugly #ifdef/#endif
Sam
next prev parent reply other threads:[~2007-07-26 20:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 20:05 Yinghai Lu
2007-07-26 20:18 ` Sam Ravnborg [this message]
2007-07-26 20:39 ` Yinghai Lu
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=20070726201815.GB6387@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yhlu.kernel@gmail.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
all inboxes | Powered by JetHome®