* [PATCH] ftrace: Format MCOUNT_ADDR address as type unsigned long
@ 2015-07-12 9:52 Minfei Huang
2015-07-13 15:04 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Minfei Huang @ 2015-07-12 9:52 UTC (permalink / raw)
To: rostedt, mingo; +Cc: linux-kernel, Minfei Huang
From: Minfei Huang <mnfhuang@gmail.com>
Always we use type unsigned long to format the ip address, since the
value of ip address is never the negative.
This patch uses type unsigned long, instead of long, to format the ip
address. The code is more clearly to be viewed by using type unsigned
long, although it is correct by using either unsigned long or long.
Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
---
arch/metag/include/asm/ftrace.h | 2 +-
arch/microblaze/include/asm/ftrace.h | 2 +-
arch/powerpc/include/asm/ftrace.h | 2 +-
arch/sh/include/asm/ftrace.h | 2 +-
arch/sparc/include/asm/ftrace.h | 2 +-
arch/x86/include/asm/ftrace.h | 4 ++--
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/metag/include/asm/ftrace.h b/arch/metag/include/asm/ftrace.h
index 2901f0f..a2269d6 100644
--- a/arch/metag/include/asm/ftrace.h
+++ b/arch/metag/include/asm/ftrace.h
@@ -6,7 +6,7 @@
#ifndef __ASSEMBLY__
extern void mcount_wrapper(void);
-#define MCOUNT_ADDR ((long)(mcount_wrapper))
+#define MCOUNT_ADDR ((unsigned long)(mcount_wrapper))
static inline unsigned long ftrace_call_adjust(unsigned long addr)
{
diff --git a/arch/microblaze/include/asm/ftrace.h b/arch/microblaze/include/asm/ftrace.h
index fd2fa2ec..da0144f 100644
--- a/arch/microblaze/include/asm/ftrace.h
+++ b/arch/microblaze/include/asm/ftrace.h
@@ -3,7 +3,7 @@
#ifdef CONFIG_FUNCTION_TRACER
-#define MCOUNT_ADDR ((long)(_mcount))
+#define MCOUNT_ADDR ((unsigned long)(_mcount))
#define MCOUNT_INSN_SIZE 8 /* sizeof mcount call */
#ifndef __ASSEMBLY__
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
index e366187..ef89b14 100644
--- a/arch/powerpc/include/asm/ftrace.h
+++ b/arch/powerpc/include/asm/ftrace.h
@@ -2,7 +2,7 @@
#define _ASM_POWERPC_FTRACE
#ifdef CONFIG_FUNCTION_TRACER
-#define MCOUNT_ADDR ((long)(_mcount))
+#define MCOUNT_ADDR ((unsigned long)(_mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
#ifdef __ASSEMBLY__
diff --git a/arch/sh/include/asm/ftrace.h b/arch/sh/include/asm/ftrace.h
index e79fb6e..1f157b8 100644
--- a/arch/sh/include/asm/ftrace.h
+++ b/arch/sh/include/asm/ftrace.h
@@ -9,7 +9,7 @@
#ifndef __ASSEMBLY__
extern void mcount(void);
-#define MCOUNT_ADDR ((long)(mcount))
+#define MCOUNT_ADDR ((unsigned long)(mcount))
#ifdef CONFIG_DYNAMIC_FTRACE
#define CALL_ADDR ((long)(ftrace_call))
diff --git a/arch/sparc/include/asm/ftrace.h b/arch/sparc/include/asm/ftrace.h
index 9ec94ad..3192a8e 100644
--- a/arch/sparc/include/asm/ftrace.h
+++ b/arch/sparc/include/asm/ftrace.h
@@ -2,7 +2,7 @@
#define _ASM_SPARC64_FTRACE
#ifdef CONFIG_MCOUNT
-#define MCOUNT_ADDR ((long)(_mcount))
+#define MCOUNT_ADDR ((unsigned long)(_mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
#ifndef __ASSEMBLY__
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index f45acad..2493885 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -3,9 +3,9 @@
#ifdef CONFIG_FUNCTION_TRACER
#ifdef CC_USING_FENTRY
-# define MCOUNT_ADDR ((long)(__fentry__))
+# define MCOUNT_ADDR ((unsigned long)(__fentry__))
#else
-# define MCOUNT_ADDR ((long)(mcount))
+# define MCOUNT_ADDR ((unsigned long)(mcount))
#endif
#define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
--
2.2.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ftrace: Format MCOUNT_ADDR address as type unsigned long
2015-07-12 9:52 [PATCH] ftrace: Format MCOUNT_ADDR address as type unsigned long Minfei Huang
@ 2015-07-13 15:04 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2015-07-13 15:04 UTC (permalink / raw)
To: Minfei Huang
Cc: mingo, linux-kernel, Minfei Huang, linux-arch, H. Peter Anvin,
James Hogan, Michal Simek, Benjamin Herrenschmidt,
David S. Miller
On Sun, 12 Jul 2015 17:52:24 +0800
Minfei Huang <mhuang@redhat.com> wrote:
> From: Minfei Huang <mnfhuang@gmail.com>
>
> Always we use type unsigned long to format the ip address, since the
> value of ip address is never the negative.
>
> This patch uses type unsigned long, instead of long, to format the ip
> address. The code is more clearly to be viewed by using type unsigned
> long, although it is correct by using either unsigned long or long.
>
The only place MCOUNT_ADDR is used in generic code is being passed into
a parameter that is already typed "unsigned long". But I'm fine with
the patch just to make it consistent. I added the appropriate Cc's for
this patch too.
-- Steve
> Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
> ---
> arch/metag/include/asm/ftrace.h | 2 +-
> arch/microblaze/include/asm/ftrace.h | 2 +-
> arch/powerpc/include/asm/ftrace.h | 2 +-
> arch/sh/include/asm/ftrace.h | 2 +-
> arch/sparc/include/asm/ftrace.h | 2 +-
> arch/x86/include/asm/ftrace.h | 4 ++--
> 6 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/metag/include/asm/ftrace.h b/arch/metag/include/asm/ftrace.h
> index 2901f0f..a2269d6 100644
> --- a/arch/metag/include/asm/ftrace.h
> +++ b/arch/metag/include/asm/ftrace.h
> @@ -6,7 +6,7 @@
>
> #ifndef __ASSEMBLY__
> extern void mcount_wrapper(void);
> -#define MCOUNT_ADDR ((long)(mcount_wrapper))
> +#define MCOUNT_ADDR ((unsigned long)(mcount_wrapper))
>
> static inline unsigned long ftrace_call_adjust(unsigned long addr)
> {
> diff --git a/arch/microblaze/include/asm/ftrace.h b/arch/microblaze/include/asm/ftrace.h
> index fd2fa2ec..da0144f 100644
> --- a/arch/microblaze/include/asm/ftrace.h
> +++ b/arch/microblaze/include/asm/ftrace.h
> @@ -3,7 +3,7 @@
>
> #ifdef CONFIG_FUNCTION_TRACER
>
> -#define MCOUNT_ADDR ((long)(_mcount))
> +#define MCOUNT_ADDR ((unsigned long)(_mcount))
> #define MCOUNT_INSN_SIZE 8 /* sizeof mcount call */
>
> #ifndef __ASSEMBLY__
> diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
> index e366187..ef89b14 100644
> --- a/arch/powerpc/include/asm/ftrace.h
> +++ b/arch/powerpc/include/asm/ftrace.h
> @@ -2,7 +2,7 @@
> #define _ASM_POWERPC_FTRACE
>
> #ifdef CONFIG_FUNCTION_TRACER
> -#define MCOUNT_ADDR ((long)(_mcount))
> +#define MCOUNT_ADDR ((unsigned long)(_mcount))
> #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
>
> #ifdef __ASSEMBLY__
> diff --git a/arch/sh/include/asm/ftrace.h b/arch/sh/include/asm/ftrace.h
> index e79fb6e..1f157b8 100644
> --- a/arch/sh/include/asm/ftrace.h
> +++ b/arch/sh/include/asm/ftrace.h
> @@ -9,7 +9,7 @@
> #ifndef __ASSEMBLY__
> extern void mcount(void);
>
> -#define MCOUNT_ADDR ((long)(mcount))
> +#define MCOUNT_ADDR ((unsigned long)(mcount))
>
> #ifdef CONFIG_DYNAMIC_FTRACE
> #define CALL_ADDR ((long)(ftrace_call))
> diff --git a/arch/sparc/include/asm/ftrace.h b/arch/sparc/include/asm/ftrace.h
> index 9ec94ad..3192a8e 100644
> --- a/arch/sparc/include/asm/ftrace.h
> +++ b/arch/sparc/include/asm/ftrace.h
> @@ -2,7 +2,7 @@
> #define _ASM_SPARC64_FTRACE
>
> #ifdef CONFIG_MCOUNT
> -#define MCOUNT_ADDR ((long)(_mcount))
> +#define MCOUNT_ADDR ((unsigned long)(_mcount))
> #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
>
> #ifndef __ASSEMBLY__
> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> index f45acad..2493885 100644
> --- a/arch/x86/include/asm/ftrace.h
> +++ b/arch/x86/include/asm/ftrace.h
> @@ -3,9 +3,9 @@
>
> #ifdef CONFIG_FUNCTION_TRACER
> #ifdef CC_USING_FENTRY
> -# define MCOUNT_ADDR ((long)(__fentry__))
> +# define MCOUNT_ADDR ((unsigned long)(__fentry__))
> #else
> -# define MCOUNT_ADDR ((long)(mcount))
> +# define MCOUNT_ADDR ((unsigned long)(mcount))
> #endif
> #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-13 15:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-12 9:52 [PATCH] ftrace: Format MCOUNT_ADDR address as type unsigned long Minfei Huang
2015-07-13 15:04 ` Steven Rostedt
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®