linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Tobin C. Harding" <me@tobin.cc>
To: Ingo Molnar <mingo@redhat.com>, Steven Rostedt <rostedt@goodmis.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, "Tobin C. Harding" <me@tobin.cc>
Subject: [PATCH] powerpc/ftrace: add ftrace.h, fix sparse warning
Date: Mon,  6 Mar 2017 19:49:46 +1100	[thread overview]
Message-ID: <1488790186-4828-1-git-send-email-me@tobin.cc> (raw)

Sparse emits warning: symbol 'prepare_ftrace_return' was not
declared. Should it be static? prepare_ftrace_return() is called
from assembler and should not be static. Adding a header file
declaring the function will fix the sparse warning while adding
documentation to the call.

Add header file ftrace.h with single function declaration. Protect
declaration with preprocessor guard so it may be included in
assembly. Include new header in all files that call
prepare_ftrace_return() and in ftrace.c where function is defined.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---

Github issue: #37 Fix sparse warnings

Tested by building on Power8.

There are a bunch of these in arch/powerpc/kernel/. Do we want to add
a header for each one, cluttering up the directory to fix the sparse
warnings? 

 arch/powerpc/kernel/entry_32.S | 2 ++
 arch/powerpc/kernel/entry_64.S | 2 ++
 arch/powerpc/kernel/ftrace.c   | 1 +
 arch/powerpc/kernel/ftrace.h   | 9 +++++++++
 4 files changed, 14 insertions(+)
 create mode 100644 arch/powerpc/kernel/ftrace.h

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 3841d74..bb7284c 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -35,6 +35,8 @@
 #include <asm/ptrace.h>
 #include <asm/export.h>
 
+#include "ftrace.h"
+
 /*
  * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
  */
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 6432d4b..8591026 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -40,6 +40,8 @@
 #include <asm/ppc-opcode.h>
 #include <asm/export.h>
 
+#include "ftrace.h"
+
 /*
  * System calls.
  */
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 5c9f50c..d4d3bb1 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -26,6 +26,7 @@
 #include <asm/ftrace.h>
 #include <asm/syscall.h>
 
+#include "ftrace.h"
 
 #ifdef CONFIG_DYNAMIC_FTRACE
 static unsigned int
diff --git a/arch/powerpc/kernel/ftrace.h b/arch/powerpc/kernel/ftrace.h
new file mode 100644
index 0000000..dc27dd7
--- /dev/null
+++ b/arch/powerpc/kernel/ftrace.h
@@ -0,0 +1,9 @@
+#ifndef _FTRACE_H
+#define _FTRACE_H
+
+#ifndef __ASSEMBLER__
+
+unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip);
+
+#endif	/* __ASSEMBLER__ */
+#endif	/* _FTRACE_H */
-- 
2.7.4

             reply	other threads:[~2017-03-06  8:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06  8:49 Tobin C. Harding [this message]
2017-03-08 11:24 ` [PATCH] powerpc/ftrace: add ftrace.h, fix sparse warning Michael Ellerman
2017-03-21 11:36 ` Michael Ellerman

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=1488790186-4828-1-git-send-email-me@tobin.cc \
    --to=me@tobin.cc \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).