All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [PATCH][RFC] Add default CPU topology information
Date: Thu, 17 Apr 2008 23:45:13 -0700	[thread overview]
Message-ID: <20080417234513.367c9ddc.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080331114412.GH21637@solarflare.com>

On Mon, 31 Mar 2008 12:44:13 +0100 Ben Hutchings <bhutchings@solarflare.com> wrote:

> Not all architectures and configurations define CPU topology information.
> This can result in an empty topology directory in sysfs, and requires
> in-kernel users to protect all uses with #ifdef - see
> <http://marc.info/?l=linux-netdev&m=120639033904472&w=2>.
> 
> The documentation of CPU topology specifies what the defaults should be
> if only partial information is available from the hardware.  So we can
> provide these defaults as a fallback.

powerpc allmodconfig:

arch/powerpc/kernel/pci_64.c:655: error: expected identifier or '(' before 'void'
arch/powerpc/kernel/pci_64.c:655: error: expected ')' before '(' token

Because this:

#ifdef CONFIG_NUMA
int pcibus_to_node(struct pci_bus *bus)
{
	struct pci_controller *phb = pci_bus_to_host(bus);
	return phb->node;
}
#endif

is expanding to

int ((void)(bus), -1)(struct pci_bus *bus)

which the compiler has trouble with.

This:

+++ a/include/asm-powerpc/topology.h
@@ -109,6 +109,8 @@ static inline void sysfs_remove_device_f
 #endif
 #endif
 
+#define pcibus_to_node pcibus_to_node
+
 #include <asm-generic/topology.h>
 
 #endif /* __KERNEL__ */
_

gets it working, by tricking the preprocessor into expanding pcibus_to_node
to itself, but it isn't exactly pleasing.


  parent reply	other threads:[~2008-04-18  6:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-31 11:44 [PATCH][RFC] Add default CPU topology information Ben Hutchings
2008-03-31 12:35 ` Ingo Molnar
2008-04-15 19:42 ` Andrew Morton
2008-04-16 12:51   ` Ingo Molnar
2008-04-16 19:07     ` Andrew Morton
2008-04-18  6:45 ` Andrew Morton [this message]
2008-04-18 12:10   ` Ben Hutchings
2008-04-18  7:10 ` Andrew Morton
2008-04-18  7:32   ` Andrew Morton
2008-04-18 12:24   ` Ben Hutchings

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=20080417234513.367c9ddc.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=bhutchings@solarflare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    /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 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.