From: Mathieu Desnoyers Date: Wed, 20 Jul 2011 19:23:34 +0000 (-0400) Subject: Remove warnings X-Git-Tag: v2.0-pre1~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=88dfd89924114cc8948c300cbd6afd3503ec0b23;p=lttng-modules.git Remove warnings Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/ring_buffer_backend.c b/lib/ringbuffer/ring_buffer_backend.c index 332a1d23..a9513d1c 100644 --- a/lib/ringbuffer/ring_buffer_backend.c +++ b/lib/ringbuffer/ring_buffer_backend.c @@ -569,11 +569,10 @@ int __lib_ring_buffer_copy_to_user(struct lib_ring_buffer_backend *bufb, struct channel_backend *chanb = &bufb->chan->backend; const struct lib_ring_buffer_config *config = chanb->config; size_t index; - ssize_t pagecpy, orig_len; + ssize_t pagecpy; struct lib_ring_buffer_backend_pages *rpages; unsigned long sb_bindex, id; - orig_len = len; offset &= chanb->buf_size - 1; index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT; if (unlikely(!len)) diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c index ecc72ab8..77356fab 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -164,7 +164,6 @@ int lib_ring_buffer_create(struct lib_ring_buffer *buf, const struct lib_ring_buffer_config *config = chanb->config; struct channel *chan = container_of(chanb, struct channel, backend); void *priv = chanb->priv; - unsigned int num_subbuf; size_t subbuf_header_size; u64 tsc; int ret; @@ -203,7 +202,6 @@ int lib_ring_buffer_create(struct lib_ring_buffer *buf, goto free_commit; } - num_subbuf = chan->backend.num_subbuf; init_waitqueue_head(&buf->read_wait); raw_spin_lock_init(&buf->raw_tick_nohz_spinlock); diff --git a/lib/ringbuffer/ring_buffer_splice.c b/lib/ringbuffer/ring_buffer_splice.c index 5fa779f5..ded18ba8 100644 --- a/lib/ringbuffer/ring_buffer_splice.c +++ b/lib/ringbuffer/ring_buffer_splice.c @@ -81,7 +81,7 @@ static int subbuf_splice_actor(struct file *in, .ops = &ring_buffer_pipe_buf_ops, .spd_release = lib_ring_buffer_page_release, }; - unsigned long consumed_old, consumed_idx, roffset; + unsigned long consumed_old, roffset; unsigned long bytes_avail; /* @@ -90,7 +90,6 @@ static int subbuf_splice_actor(struct file *in, WARN_ON(atomic_long_read(&buf->active_readers) != 1); consumed_old = lib_ring_buffer_get_consumed(config, buf); consumed_old += *ppos; - consumed_idx = subbuf_index(consumed_old, chan); /* * Adjust read len, if longer than what is available. diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c index cfc364a8..fe5f5b1b 100644 --- a/ltt-debugfs-abi.c +++ b/ltt-debugfs-abi.c @@ -247,7 +247,6 @@ void lttng_metadata_create_events(struct file *channel_file) .name = "lttng_metadata", }; struct ltt_event *event; - int ret; /* * We tolerate no failure path after event creation. It will stay @@ -255,7 +254,6 @@ void lttng_metadata_create_events(struct file *channel_file) */ event = ltt_event_create(channel, &metadata_params, NULL); if (!event) { - ret = -EINVAL; goto create_error; } return; @@ -271,7 +269,7 @@ int lttng_abi_create_channel(struct file *session_file, enum channel_type channel_type) { struct ltt_session *session = session_file->private_data; - const struct file_operations *fops; + const struct file_operations *fops = NULL; const char *transport_name; struct ltt_channel *chan; struct file *chan_file; @@ -286,8 +284,17 @@ int lttng_abi_create_channel(struct file *session_file, ret = chan_fd; goto fd_error; } + switch (channel_type) { + case PER_CPU_CHANNEL: + fops = <tng_channel_fops; + break; + case METADATA_CHANNEL: + fops = <tng_metadata_fops; + break; + } + chan_file = anon_inode_getfile("[lttng_channel]", - <tng_channel_fops, + fops, NULL, O_RDWR); if (IS_ERR(chan_file)) { ret = PTR_ERR(chan_file); @@ -304,7 +311,6 @@ int lttng_abi_create_channel(struct file *session_file, } else { return -EINVAL; } - fops = <tng_channel_fops; break; case METADATA_CHANNEL: if (chan_param.output == LTTNG_KERNEL_SPLICE) @@ -313,7 +319,6 @@ int lttng_abi_create_channel(struct file *session_file, transport_name = "relay-metadata-mmap"; else return -EINVAL; - fops = <tng_metadata_fops; break; default: transport_name = "";