[ltt-dev] [PATCH 3/4] Fix a compile warning of 'initialization from incompatible pointer type'

Zhaolei zhaolei at cn.fujitsu.com
Thu Oct 23 06:46:59 EDT 2008


Warning is:
ltt/ltt-relay.c:1602: warning: initialization from incompatible pointer type

Return value of ltt_relay_reserve_slot should be int because it only return
errorcode or 0.

Signed-off-by: Zhao Lei <zhaolei at cn.fujitsu.com>
---
 include/linux/ltt-tracer.h |    2 +-
 ltt/ltt-relay-locked.c     |    2 +-
 ltt/ltt-relay.c            |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/ltt-tracer.h b/include/linux/ltt-tracer.h
index a1c6c14..f7cb1d1 100644
--- a/include/linux/ltt-tracer.h
+++ b/include/linux/ltt-tracer.h
@@ -174,7 +174,7 @@ struct user_dbg_data {
 
 struct ltt_trace_ops {
 	/* First 32 bytes cache-hot cacheline */
-	ssize_t (*reserve_slot) (struct ltt_trace_struct *trace,
+	int (*reserve_slot) (struct ltt_trace_struct *trace,
 				struct ltt_channel_struct *channel,
 				void **transport_data, size_t data_size,
 				size_t *slot_size, long *buf_offset, u64 *tsc,
diff --git a/ltt/ltt-relay-locked.c b/ltt/ltt-relay-locked.c
index 779ff89..ab402f8 100644
--- a/ltt/ltt-relay-locked.c
+++ b/ltt/ltt-relay-locked.c
@@ -1252,7 +1252,7 @@ static inline void ltt_reserve_end_switch_current(
  *
  * It will take care of sub-buffer switching.
  */
-static notrace long ltt_relay_reserve_slot(struct ltt_trace_struct *trace,
+static notrace int ltt_relay_reserve_slot(struct ltt_trace_struct *trace,
 		struct ltt_channel_struct *ltt_channel, void **transport_data,
 		size_t data_size, size_t *slot_size, long *buf_offset, u64 *tsc,
 		unsigned int *rflags, int largest_align, int cpu)
diff --git a/ltt/ltt-relay.c b/ltt/ltt-relay.c
index 86f5082..5667ab8 100644
--- a/ltt/ltt-relay.c
+++ b/ltt/ltt-relay.c
@@ -1278,7 +1278,7 @@ static inline void ltt_reserve_end_switch_current(
  *
  * It will take care of sub-buffer switching.
  */
-static notrace long ltt_relay_reserve_slot(struct ltt_trace_struct *trace,
+static notrace int ltt_relay_reserve_slot(struct ltt_trace_struct *trace,
 		struct ltt_channel_struct *ltt_channel, void **transport_data,
 		size_t data_size, size_t *slot_size, long *buf_offset, u64 *tsc,
 		unsigned int *rflags, int largest_align, int cpu)
-- 
1.5.5.3






More information about the lttng-dev mailing list