public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Rakib Mullick <rakib.mullick@gmail.com>
Subject: [PATCH 02/12] x86/ftrace: Fix compiler warning in ftrace.c
Date: Thu, 26 May 2011 11:25:44 -0400	[thread overview]
Message-ID: <20110526152955.636240192@goodmis.org> (raw)
In-Reply-To: 20110526152541.995963172@goodmis.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0002-x86-ftrace-Fix-compiler-warning-in-ftrace.c.patch --]
[-- Type: text/plain, Size: 2865 bytes --]

From: Rakib Mullick <rakib.mullick@gmail.com>

 Due to commit dc326fca2b64 (x86, cpu: Clean up and unify the NOP selection infrastructure), we get the following warning:

arch/x86/kernel/ftrace.c: In function ‘ftrace_make_nop’:
arch/x86/kernel/ftrace.c:308:6: warning: assignment discards qualifiers from pointer target type
arch/x86/kernel/ftrace.c: In function ‘ftrace_make_call’:
arch/x86/kernel/ftrace.c:318:6: warning: assignment discards qualifiers from pointer target type

ftrace_nop_replace() now returns const unsigned char *, so change its associated function/variable to its compatible type to keep compiler clam.

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
Link: http://lkml.kernel.org/r/1305221620.7986.4.camel@localhost.localdomain

[ updated for change of const void *src in probe_kernel_write() ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 arch/x86/kernel/ftrace.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 0ba15a6..c9a281f 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -123,7 +123,7 @@ static unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr)
 static atomic_t nmi_running = ATOMIC_INIT(0);
 static int mod_code_status;		/* holds return value of text write */
 static void *mod_code_ip;		/* holds the IP to write to */
-static void *mod_code_newcode;		/* holds the text to write to the IP */
+static const void *mod_code_newcode;	/* holds the text to write to the IP */
 
 static unsigned nmi_wait_count;
 static atomic_t nmi_update_count = ATOMIC_INIT(0);
@@ -225,7 +225,7 @@ within(unsigned long addr, unsigned long start, unsigned long end)
 }
 
 static int
-do_ftrace_mod_code(unsigned long ip, void *new_code)
+do_ftrace_mod_code(unsigned long ip, const void *new_code)
 {
 	/*
 	 * On x86_64, kernel text mappings are mapped read-only with
@@ -266,8 +266,8 @@ static const unsigned char *ftrace_nop_replace(void)
 }
 
 static int
-ftrace_modify_code(unsigned long ip, unsigned char *old_code,
-		   unsigned char *new_code)
+ftrace_modify_code(unsigned long ip, unsigned const char *old_code,
+		   unsigned const char *new_code)
 {
 	unsigned char replaced[MCOUNT_INSN_SIZE];
 
@@ -301,7 +301,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
 int ftrace_make_nop(struct module *mod,
 		    struct dyn_ftrace *rec, unsigned long addr)
 {
-	unsigned char *new, *old;
+	unsigned const char *new, *old;
 	unsigned long ip = rec->ip;
 
 	old = ftrace_call_replace(ip, addr);
@@ -312,7 +312,7 @@ int ftrace_make_nop(struct module *mod,
 
 int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
 {
-	unsigned char *new, *old;
+	unsigned const char *new, *old;
 	unsigned long ip = rec->ip;
 
 	old = ftrace_nop_replace();
-- 
1.7.4.4



  parent reply	other threads:[~2011-05-26 15:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26 15:25 [PATCH 00/12] [GIT PULL] tracing: fixes Steven Rostedt
2011-05-26 15:25 ` [PATCH 01/12] maccess,probe_kernel: Make write/read src const void * Steven Rostedt
2011-05-26 15:25 ` Steven Rostedt [this message]
2011-05-26 15:25 ` [PATCH 03/12] scripts/tags.sh: Fix ctags for DEFINE_EVENT() Steven Rostedt
2011-05-26 15:25 ` [PATCH 04/12] scripts/tags.sh: Add magic for trace-events for etags too Steven Rostedt
2011-05-26 15:38   ` Peter Zijlstra
2011-05-26 15:25 ` [PATCH 05/12] ftrace/recordmcount: Avoid STT_FUNC symbols as base on ARM Steven Rostedt
2011-05-26 15:25 ` [PATCH 06/12] jump_label: Check entries limit in __jump_label_update Steven Rostedt
2011-05-26 15:25 ` [PATCH 07/12] ftrace: Have ftrace_startup() return failure code Steven Rostedt
2011-05-26 15:25 ` [PATCH 08/12] tracing: Have event with function tracer check error return Steven Rostedt
2011-05-26 15:25 ` [PATCH 09/12] ftrace: Set ops->flag to enabled even on static function tracing Steven Rostedt
2011-05-26 15:25 ` [PATCH 10/12] tracing: Add __print_symbolic_u64 to avoid warnings on 32bit machine Steven Rostedt
2011-05-26 15:25 ` [PATCH 11/12] tracing: Update btrfss tracepoints to use u64 interface Steven Rostedt
2011-05-26 15:25 ` [PATCH 12/12] ftrace: Add internal recursive checks Steven Rostedt
2011-05-26 16:18   ` Witold Baryluk
2011-05-26 16:54   ` Paul E. McKenney
2011-05-27 12:46 ` [PATCH 00/12] [GIT PULL] tracing: fixes Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2011-05-24 18:10 [PATCH 00/12] [GIT PULL][2.6.40/2.8.0/3.0] tracing: clean ups and fixes Steven Rostedt
2011-05-24 18:10 ` [PATCH 02/12] x86/ftrace: Fix compiler warning in ftrace.c Steven Rostedt

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=20110526152955.636240192@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rakib.mullick@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox