Remove warnings
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 20 Jul 2011 19:23:34 +0000 (15:23 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 20 Jul 2011 19:23:34 +0000 (15:23 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_backend.c
lib/ringbuffer/ring_buffer_frontend.c
lib/ringbuffer/ring_buffer_splice.c
ltt-debugfs-abi.c

index 332a1d23ae46fef3484670d9b4c8c7e6ad252b31..a9513d1c07e3072fc9e6f6dcd5418554a1af8255 100644 (file)
@@ -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))
index ecc72ab84f7e3143f930e77cac0bc6ad3de16a8e..77356fab5b260b16201a42229ec7c7496a058395 100644 (file)
@@ -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);
 
index 5fa779f5a63e1038ad477abea8d7807a335fbf2c..ded18ba80fc1d02949cb9931cdc1f5049a929ef7 100644 (file)
@@ -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.
index cfc364a844635f1476a17e7e7c794b73478f6017..fe5f5b1b354310ea0c083cb53c3504aae7c875c9 100644 (file)
@@ -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 = &lttng_channel_fops;
+               break;
+       case METADATA_CHANNEL:
+               fops = &lttng_metadata_fops;
+               break;
+       }
+               
        chan_file = anon_inode_getfile("[lttng_channel]",
-                                      &lttng_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 = &lttng_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 = &lttng_metadata_fops;
                break;
        default:
                transport_name = "<unknown>";
This page took 0.029601 seconds and 4 git commands to generate.