public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/6] trace: make argument 'mem' of trace_seq_putmem() const
Date: Fri, 27 Mar 2009 10:21:00 +0800	[thread overview]
Message-ID: <49CC380C.4010700@cn.fujitsu.com> (raw)
In-Reply-To: <49CC37AA.3060908@cn.fujitsu.com>

I passed a const value to trace_seq_putmem(), and I got compile warning.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 kernel/trace/trace_output.c |    6 +++---
 kernel/trace/trace_output.h |    5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 6595074..d72b9a6 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -137,7 +137,7 @@ int trace_seq_putc(struct trace_seq *s, unsigned char c)
 	return 1;
 }
 
-int trace_seq_putmem(struct trace_seq *s, void *mem, size_t len)
+int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len)
 {
 	if (len > ((PAGE_SIZE - 1) - s->len))
 		return 0;
@@ -148,10 +148,10 @@ int trace_seq_putmem(struct trace_seq *s, void *mem, size_t len)
 	return len;
 }
 
-int trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len)
+int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, size_t len)
 {
 	unsigned char hex[HEX_CHARS];
-	unsigned char *data = mem;
+	const unsigned char *data = mem;
 	int i, j;
 
 #ifdef __BIG_ENDIAN
diff --git a/kernel/trace/trace_output.h b/kernel/trace/trace_output.h
index 46fb961..e0bde39 100644
--- a/kernel/trace/trace_output.h
+++ b/kernel/trace/trace_output.h
@@ -31,8 +31,9 @@ extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
 				 size_t cnt);
 extern int trace_seq_puts(struct trace_seq *s, const char *str);
 extern int trace_seq_putc(struct trace_seq *s, unsigned char c);
-extern int trace_seq_putmem(struct trace_seq *s, void *mem, size_t len);
-extern int trace_seq_putmem_hex(struct trace_seq *s, void *mem, size_t len);
+extern int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len);
+extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
+				size_t len);
 extern void *trace_seq_reserve(struct trace_seq *s, size_t len);
 extern int trace_seq_path(struct trace_seq *s, struct path *path);
 extern int seq_print_userip_objs(const struct userstack_entry *entry,
-- 
1.5.4.rc3


  parent reply	other threads:[~2009-03-27  2:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27  2:19 [PATCH 0/6] blktrace: last round of fixes Li Zefan
2009-03-27  2:19 ` [PATCH 1/6] blktrace: make classic output more classic Li Zefan
2009-03-27  3:30   ` Li Zefan
2009-03-28 21:27   ` [tip:tracing/blktrace] " Li Zefan
2009-03-30  1:19   ` Li Zefan
2009-03-27  2:20 ` [PATCH 2/6] blktrace: fix blk_probes_ref chaos Li Zefan
2009-03-28 21:28   ` [tip:tracing/blktrace] " Li Zefan
2009-03-30  1:19   ` Li Zefan
2009-03-27  2:20 ` [PATCH 3/6] blktrace: fix memory leak when freeing struct blk_io_trace Li Zefan
2009-03-28 21:28   ` [tip:tracing/blktrace] " Li Zefan
2009-03-30  1:19   ` Li Zefan
2009-03-27  2:21 ` Li Zefan [this message]
2009-03-28 21:28   ` [tip:tracing/blktrace] trace: make argument 'mem' of trace_seq_putmem() const Li Zefan
2009-03-30  1:20   ` Li Zefan
2009-03-27  2:21 ` [PATCH 5/6] blktrace: extract duplidate code Li Zefan
2009-03-28 21:28   ` [tip:tracing/blktrace] " Li Zefan
2009-03-30  1:20   ` Li Zefan
2009-03-27  2:21 ` [PATCH 6/6] blktrace: print out BLK_TN_MESSAGE properly Li Zefan
2009-03-28 21:28   ` [tip:tracing/blktrace] " Li Zefan
2009-03-30  1:20   ` Li Zefan

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=49CC380C.4010700@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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