public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel/profile.c: Fix section mismatch warning.
@ 2008-11-18  4:15 Rakib Mullick
  2008-11-18  7:48 ` Ingo Molnar
  2008-11-19  6:19 ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: Rakib Mullick @ 2008-11-18  4:15 UTC (permalink / raw)
  To: Linux-kernel Mailing List; +Cc: Ingo Molnar, Andrew Morton

Impact: Fix section mismatch warning in kernel/profile.c

Here, profile_nop function has been called from a non-init function
create_hash_tables(void). Which generetes a section mismatch warning.
Previously, create_hash_tables(void) was a init function. So, removing
__init from create_hash_tables(void) requires profile_nop to be
non-init. This patch makes profile_nop function inline and fixes the
following warning:

WARNING: vmlinux.o(.text+0x6ebb6): Section mismatch in reference from
the function create_hash_tables() to the function
.init.text:profile_nop()
The function create_hash_tables() references
the function __init profile_nop().
This is often because create_hash_tables lacks a __init
annotation or the annotation of profile_nop is wrong.


Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

--- linux-2.6-orig/kernel/profile.c	2008-11-17 20:30:42.000000000 +0600
+++ linux-2.6/kernel/profile.c	2008-11-18 09:39:58.000000000 +0600
@@ -544,7 +544,7 @@ static const struct file_operations proc
 };

 #ifdef CONFIG_SMP
-static void __init profile_nop(void *unused)
+static inline void profile_nop(void *unused)
 {
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/profile.c: Fix section mismatch warning.
  2008-11-18  4:15 [PATCH] kernel/profile.c: Fix section mismatch warning Rakib Mullick
@ 2008-11-18  7:48 ` Ingo Molnar
  2008-11-19  6:19 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2008-11-18  7:48 UTC (permalink / raw)
  To: Rakib Mullick; +Cc: Linux-kernel Mailing List, Andrew Morton


* Rakib Mullick <rakib.mullick@gmail.com> wrote:

> Impact: Fix section mismatch warning in kernel/profile.c
> 
> Here, profile_nop function has been called from a non-init function
> create_hash_tables(void). Which generetes a section mismatch warning.
> Previously, create_hash_tables(void) was a init function. So, removing
> __init from create_hash_tables(void) requires profile_nop to be
> non-init. This patch makes profile_nop function inline and fixes the
> following warning:
> 
> WARNING: vmlinux.o(.text+0x6ebb6): Section mismatch in reference from
> the function create_hash_tables() to the function
> .init.text:profile_nop()
> The function create_hash_tables() references
> the function __init profile_nop().
> This is often because create_hash_tables lacks a __init
> annotation or the annotation of profile_nop is wrong.
> 
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> 
> --- linux-2.6-orig/kernel/profile.c	2008-11-17 20:30:42.000000000 +0600
> +++ linux-2.6/kernel/profile.c	2008-11-18 09:39:58.000000000 +0600
> @@ -544,7 +544,7 @@ static const struct file_operations proc
>  };
> 
>  #ifdef CONFIG_SMP
> -static void __init profile_nop(void *unused)
> +static inline void profile_nop(void *unused)
>  {
>  }

applied to tip/core/urgent, thanks!

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/profile.c: Fix section mismatch warning.
  2008-11-18  4:15 [PATCH] kernel/profile.c: Fix section mismatch warning Rakib Mullick
  2008-11-18  7:48 ` Ingo Molnar
@ 2008-11-19  6:19 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2008-11-19  6:19 UTC (permalink / raw)
  To: Rakib Mullick; +Cc: Linux-kernel Mailing List, Ingo Molnar

On Tue, 18 Nov 2008 10:15:24 +0600 "Rakib Mullick" <rakib.mullick@gmail.com> wrote:

> Impact: Fix section mismatch warning in kernel/profile.c
> 
> Here, profile_nop function has been called from a non-init function
> create_hash_tables(void). Which generetes a section mismatch warning.
> Previously, create_hash_tables(void) was a init function. So, removing
> __init from create_hash_tables(void) requires profile_nop to be
> non-init. This patch makes profile_nop function inline and fixes the
> following warning:
> 
> WARNING: vmlinux.o(.text+0x6ebb6): Section mismatch in reference from
> the function create_hash_tables() to the function
> .init.text:profile_nop()
> The function create_hash_tables() references
> the function __init profile_nop().
> This is often because create_hash_tables lacks a __init
> annotation or the annotation of profile_nop is wrong.
> 
> 
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> 
> --- linux-2.6-orig/kernel/profile.c	2008-11-17 20:30:42.000000000 +0600
> +++ linux-2.6/kernel/profile.c	2008-11-18 09:39:58.000000000 +0600
> @@ -544,7 +544,7 @@ static const struct file_operations proc
>  };
> 
>  #ifdef CONFIG_SMP
> -static void __init profile_nop(void *unused)
> +static inline void profile_nop(void *unused)
>  {
>  }

Thanks.

There's no point in declaring this as inline, since it is always called
indirectly, via on_each_cpu().

There would be a teeny point in inlining an on_each_cpu() function in
uniprocessor code, because in that case it _would_ be inlined.  But a)
that's a bit dopey and b) this code you're patching is SMP-only.

So...

--- a/kernel/profile.c~kernel-profilec-fix-section-mismatch-warning-fix
+++ a/kernel/profile.c
@@ -544,7 +544,7 @@ static const struct file_operations proc
 };
 
 #ifdef CONFIG_SMP
-static inline void profile_nop(void *unused)
+static void profile_nop(void *unused)
 {
 }
 
_


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-19  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-18  4:15 [PATCH] kernel/profile.c: Fix section mismatch warning Rakib Mullick
2008-11-18  7:48 ` Ingo Molnar
2008-11-19  6:19 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox