All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: xen-devel@lists.xensource.com
Cc: Ian Campbell <Ian.Campbell@xensource.com>
Subject: static and __init symbols in machine_kexec.c
Date: Wed, 16 May 2007 15:49:19 +0900	[thread overview]
Message-ID: <1179298159.23300@tabatha.lab.ultramonkey.org> (raw)

As per the patch, some symbols that really ought to be __init or static aren't.

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 
 linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Curiously, making xen_max_nr_phys_cpus __init causes a section missmatch
error at compile time. I guess this is to do with the way global ints
are handled. I confirmed that its consistent across x86_32, x86_64 and
ia64. So I guess its ok to leave it as is.

/home/horms/work/xen/xen-ia64-unstable.hg/linux-2.6.18-xen/drivers/xen/core/machine_kexec.c:14:
error: xen_max_nr_phys_cpus causes a section type conflict

Index: xen-ia64-unstable.hg/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c
===================================================================
--- xen-ia64-unstable.hg.orig/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c	2007-05-16 15:46:33.000000000 +0900
+++ xen-ia64-unstable.hg/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c	2007-05-16 15:54:43.000000000 +0900
@@ -11,11 +11,11 @@
 extern void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, 
 					 struct kimage *image);
 
-int xen_max_nr_phys_cpus;
-struct resource xen_hypervisor_res;
-struct resource *xen_phys_cpus;
+static int xen_max_nr_phys_cpus;
+static struct __init resource xen_hypervisor_res;
+static struct __init resource *xen_phys_cpus;
 
-void xen_machine_kexec_setup_resources(void)
+void __init xen_machine_kexec_setup_resources(void)
 {
 	xen_kexec_range_t range;
 	struct resource *res;
@@ -104,7 +104,7 @@ void xen_machine_kexec_setup_resources(v
 	return;
 }
 
-void xen_machine_kexec_register_resources(struct resource *res)
+void __init xen_machine_kexec_register_resources(struct resource *res)
 {
 	int k;

             reply	other threads:[~2007-05-16  6:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16  6:49 Simon Horman [this message]
2007-05-16  6:49 ` [Patch v2] static and __init symbols in machine_kexec.c Simon Horman
2007-05-16  7:21   ` Keir Fraser
2007-05-16  7:31     ` Simon Horman
2007-05-16  6:49       ` [Patch v3] static, __init and __initdata " Simon Horman, Keir Fraser
2007-05-16  6:49         ` [Patch v4] " Simon Horman, Keir Fraser
2007-05-16  8:16         ` [Patch v3] " Ian Campbell
2007-05-16  9:07           ` Simon Horman
2007-05-16  9:11             ` Keir Fraser
2007-05-16  9:32               ` Simon Horman
2007-05-16  7:58       ` [Patch v2] static and __init " Simon Horman

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=1179298159.23300@tabatha.lab.ultramonkey.org \
    --to=horms@verge.net.au \
    --cc=Ian.Campbell@xensource.com \
    --cc=xen-devel@lists.xensource.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 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.