[ltt-dev] [PATCH] unsigned -> unsigned int

Zhaolei zhaolei at cn.fujitsu.com
Fri Dec 5 03:16:41 EST 2008


unsigned int is better.

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

diff --git a/include/linux/ltt-tracer.h b/include/linux/ltt-tracer.h
index 005b353..97f7056 100644
--- a/include/linux/ltt-tracer.h
+++ b/include/linux/ltt-tracer.h
@@ -228,9 +228,9 @@ struct ltt_trace_struct {
 	struct ltt_channel_struct *channels[NR_LTT_CHANNELS];
 	struct {
 		struct {
-			unsigned subbuf_size;
-			unsigned subbuf_cnt;
-			unsigned flags;
+			unsigned int subbuf_size;
+			unsigned int subbuf_cnt;
+			unsigned int flags;
 		} channels[NR_LTT_CHANNELS];
 	} setting;
 	u32 freq_scale;
@@ -668,25 +668,25 @@ enum ltt_control_msg {
 union ltt_control_args {
 	struct {
 		enum trace_mode mode;
-		unsigned subbuf_size_low;
-		unsigned n_subbufs_low;
-		unsigned subbuf_size_med;
-		unsigned n_subbufs_med;
-		unsigned subbuf_size_high;
-		unsigned n_subbufs_high;
+		unsigned int subbuf_size_low;
+		unsigned int n_subbufs_low;
+		unsigned int subbuf_size_med;
+		unsigned int n_subbufs_med;
+		unsigned int subbuf_size_high;
+		unsigned int n_subbufs_high;
 	} new_trace;
 };
 
 int ltt_trace_setup(const char *trace_name);
 int ltt_trace_set_type(const char *trace_name, const char *trace_type);
 int ltt_trace_set_channel_subbufsize(const char *trace_name,
-		const char *channel_name, unsigned size);
+		const char *channel_name, unsigned int size);
 int ltt_trace_set_channel_subbufcount(const char *trace_name,
-		const char *channel_name, unsigned cnt);
+		const char *channel_name, unsigned int cnt);
 int ltt_trace_set_channel_enable(const char *trace_name,
-		const char *channel_name, unsigned enable);
+		const char *channel_name, unsigned int enable);
 int ltt_trace_set_channel_overwrite(const char *trace_name,
-		const char *channel_name, unsigned overwrite);
+		const char *channel_name, unsigned int overwrite);
 int ltt_trace_alloc(const char *trace_name);
 int ltt_trace_destroy(const char *trace_name);
 int ltt_trace_start(const char *trace_name);
diff --git a/ltt/ltt-relay-locked.c b/ltt/ltt-relay-locked.c
index 2707949..17accb7 100644
--- a/ltt/ltt-relay-locked.c
+++ b/ltt/ltt-relay-locked.c
@@ -135,7 +135,7 @@ static int ltt_relay_create_buffer(struct ltt_trace_struct *trace,
 		struct ltt_channel_struct *ltt_chan,
 		struct rchan_buf *buf,
 		unsigned int cpu,
-		unsigned n_subbufs);
+		unsigned int n_subbufs);
 
 static void ltt_relay_destroy_buffer(struct ltt_channel_struct *ltt_chan,
 		unsigned int cpu);
@@ -185,7 +185,7 @@ static notrace void ltt_buffer_end_callback(struct rchan_buf *buf,
 	header->subbuf_corrupt = ltt_buf->corrupted_subbuffers;
 }
 
-static notrace void ltt_deliver(struct rchan_buf *buf, unsigned subbuf_idx,
+static notrace void ltt_deliver(struct rchan_buf *buf, unsigned int subbuf_idx,
 		void *subbuf)
 {
 	struct ltt_channel_struct *channel =
@@ -236,7 +236,7 @@ static int ltt_remove_buf_file_callback(struct dentry *dentry)
  * This function should not be called from NMI interrupt context
  */
 static notrace void ltt_buf_unfull(struct rchan_buf *buf,
-		unsigned subbuf_idx,
+		unsigned int subbuf_idx,
 		long offset)
 {
 	struct ltt_channel_struct *ltt_channel =
@@ -430,7 +430,8 @@ static int ltt_ioctl(struct inode *inode, struct file *filp,
 }
 
 #ifdef CONFIG_COMPAT
-static long ltt_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
+static long ltt_compat_ioctl(struct file *file, unsigned int cmd,
+		unsigned long arg)
 {
 	long ret = -ENOIOCTLCMD;
 
@@ -674,7 +675,7 @@ static void ltt_wakeup_writers(struct work_struct *work)
  */
 static int ltt_relay_create_buffer(struct ltt_trace_struct *trace,
 		struct ltt_channel_struct *ltt_chan, struct rchan_buf *buf,
-		unsigned int cpu, unsigned n_subbufs)
+		unsigned int cpu, unsigned int n_subbufs)
 {
 	struct ltt_channel_buf_struct *ltt_buf =
 		percpu_ptr(ltt_chan->buf, cpu);
diff --git a/ltt/ltt-relay.c b/ltt/ltt-relay.c
index 1cb9162..03fef11 100644
--- a/ltt/ltt-relay.c
+++ b/ltt/ltt-relay.c
@@ -143,7 +143,7 @@ static int ltt_relay_create_buffer(struct ltt_trace_struct *trace,
 		struct ltt_channel_struct *ltt_chan,
 		struct rchan_buf *buf,
 		unsigned int cpu,
-		unsigned n_subbufs);
+		unsigned int n_subbufs);
 
 static void ltt_relay_destroy_buffer(struct ltt_channel_struct *ltt_chan,
 		unsigned int cpu);
@@ -193,7 +193,7 @@ static notrace void ltt_buffer_end_callback(struct rchan_buf *buf,
 	header->subbuf_corrupt = local_read(&ltt_buf->corrupted_subbuffers);
 }
 
-static notrace void ltt_deliver(struct rchan_buf *buf, unsigned subbuf_idx,
+static notrace void ltt_deliver(struct rchan_buf *buf, unsigned int subbuf_idx,
 		void *subbuf)
 {
 	struct ltt_channel_struct *channel =
@@ -244,7 +244,7 @@ static int ltt_remove_buf_file_callback(struct dentry *dentry)
  * This function should not be called from NMI interrupt context
  */
 static notrace void ltt_buf_unfull(struct rchan_buf *buf,
-		unsigned subbuf_idx,
+		unsigned int subbuf_idx,
 		long offset)
 {
 	struct ltt_channel_struct *ltt_channel =
@@ -428,7 +428,8 @@ static int ltt_ioctl(struct inode *inode, struct file *filp,
 }
 
 #ifdef CONFIG_COMPAT
-static long ltt_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
+static long ltt_compat_ioctl(struct file *file, unsigned int cmd,
+		unsigned long arg)
 {
 	long ret = -ENOIOCTLCMD;
 
@@ -675,7 +676,7 @@ static void ltt_wakeup_writers(struct work_struct *work)
  */
 static int ltt_relay_create_buffer(struct ltt_trace_struct *trace,
 		struct ltt_channel_struct *ltt_chan, struct rchan_buf *buf,
-		unsigned int cpu, unsigned n_subbufs)
+		unsigned int cpu, unsigned int n_subbufs)
 {
 	struct ltt_channel_buf_struct *ltt_buf =
 		percpu_ptr(ltt_chan->buf, cpu);
diff --git a/ltt/ltt-tracer.c b/ltt/ltt-tracer.c
index 474ffdd..1ed1e74 100644
--- a/ltt/ltt-tracer.c
+++ b/ltt/ltt-tracer.c
@@ -368,8 +368,9 @@ void ltt_release_trace(struct kref *kref)
 }
 EXPORT_SYMBOL_GPL(ltt_release_trace);
 
-static inline void prepare_chan_size_num(unsigned *subbuf_size,
-	unsigned *n_subbufs, unsigned default_size, unsigned default_n_subbufs)
+static inline void prepare_chan_size_num(
+		unsigned int *subbuf_size, unsigned int *n_subbufs,
+		unsigned int default_size, unsigned int default_n_subbufs)
 {
 	if (*subbuf_size == 0)
 		*subbuf_size = default_size;
@@ -480,7 +481,7 @@ traces_error:
 EXPORT_SYMBOL_GPL(ltt_trace_set_type);
 
 int ltt_trace_set_channel_subbufsize(const char *trace_name,
-		const char *channel_name, unsigned size)
+		const char *channel_name, unsigned int size)
 {
 	int err = 0;
 	struct ltt_trace_struct *trace;
@@ -512,7 +513,7 @@ traces_error:
 EXPORT_SYMBOL_GPL(ltt_trace_set_channel_subbufsize);
 
 int ltt_trace_set_channel_subbufcount(const char *trace_name,
-		const char *channel_name, unsigned cnt)
+		const char *channel_name, unsigned int cnt)
 {
 	int err = 0;
 	struct ltt_trace_struct *trace;
@@ -544,7 +545,7 @@ traces_error:
 EXPORT_SYMBOL_GPL(ltt_trace_set_channel_subbufcount);
 
 int ltt_trace_set_channel_enable(const char *trace_name,
-		const char *channel_name, unsigned enable)
+		const char *channel_name, unsigned int enable)
 {
 	int err = 0;
 	struct ltt_trace_struct *trace;
@@ -590,7 +591,7 @@ traces_error:
 EXPORT_SYMBOL_GPL(ltt_trace_set_channel_enable);
 
 int ltt_trace_set_channel_overwrite(const char *trace_name,
-		const char *channel_name, unsigned overwrite)
+		const char *channel_name, unsigned int overwrite)
 {
 	int err = 0;
 	struct ltt_trace_struct *trace;
@@ -751,9 +752,9 @@ EXPORT_SYMBOL_GPL(ltt_trace_alloc);
  */
 static int ltt_trace_create(const char *trace_name, const char *trace_type,
 		enum trace_mode mode,
-		unsigned subbuf_size_low, unsigned n_subbufs_low,
-		unsigned subbuf_size_med, unsigned n_subbufs_med,
-		unsigned subbuf_size_high, unsigned n_subbufs_high)
+		unsigned int subbuf_size_low, unsigned int n_subbufs_low,
+		unsigned int subbuf_size_med, unsigned int n_subbufs_med,
+		unsigned int subbuf_size_high, unsigned int n_subbufs_high)
 {
 	int err = 0;
 
-- 
1.5.5.3






More information about the lttng-dev mailing list