Module: xenomai-2.6
Branch: master
Commit: eaf53c61eca540bb7fcd612b60e84531e1bc2fbd
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=eaf53c61eca540bb7fcd612b60e84531e1bc2fbd

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Sep  3 10:54:42 2012 +0200

nucleus, skin: silence pedantic warnings (-Wunused-but-set-variable)

---

 ksrc/nucleus/heap.c       |    5 +----
 ksrc/nucleus/sched.c      |    1 +
 ksrc/nucleus/shadow.c     |   14 +++++++-------
 ksrc/nucleus/timebase.c   |    4 ++--
 ksrc/skins/posix/mq.c     |    2 +-
 ksrc/skins/posix/sem.c    |    2 +-
 ksrc/skins/posix/signal.c |    1 +
 ksrc/skins/posix/thread.c |    2 ++
 8 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c
index e0715d6..568ba27 100644
--- a/ksrc/nucleus/heap.c
+++ b/ksrc/nucleus/heap.c
@@ -1045,9 +1045,9 @@ EXPORT_SYMBOL_GPL(xnheap_finalize_free_inner);
 int xnheap_check_block(xnheap_t *heap, void *block)
 {
        xnextent_t *extent = NULL;
-       u_long pagenum, boffset;
        xnholder_t *holder;
        int ptype, err = 0;
+       u_long pagenum;
        spl_t s;
 
        xnlock_get_irqsave(&heap->lock, s);
@@ -1068,9 +1068,6 @@ int xnheap_check_block(xnheap_t *heap, void *block)
 
        /* Compute the heading page number in the page map. */
        pagenum = ((caddr_t) block - extent->membase) >> heap->pageshift;
-       boffset =
-           ((caddr_t) block -
-            (extent->membase + (pagenum << heap->pageshift)));
        ptype = extent->pagemap[pagenum].type;
 
        if (ptype == XNHEAP_PFREE ||    /* Unallocated page? */
diff --git a/ksrc/nucleus/sched.c b/ksrc/nucleus/sched.c
index 8011266..3f4068b 100644
--- a/ksrc/nucleus/sched.c
+++ b/ksrc/nucleus/sched.c
@@ -349,6 +349,7 @@ struct xnsched *xnsched_finish_unlocked_switch(struct 
xnsched *sched)
        spl_t s;
 
        xnlock_get_irqsave(&nklock, s);
+       (void)s;
 
 #ifdef CONFIG_SMP
        /* If current thread migrated while suspended */
diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index f6165bb..260fdef 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -1930,8 +1930,8 @@ void xnshadow_signal_completion(xncompletion_t __user 
*u_completion, int err)
 {
        xncompletion_t completion;
        struct task_struct *p;
-       int discarded;
        pid_t pid;
+       int ret;
 
        /* Hold a mutex to avoid missing a wakeup signal. */
        down(&completion_mutex);
@@ -1943,7 +1943,8 @@ void xnshadow_signal_completion(xncompletion_t __user 
*u_completion, int err)
 
        /* Poor man's semaphore V. */
        completion.syncflag = err ? : completion_value_ok;
-       discarded = __xn_safe_copy_to_user(u_completion, &completion, 
sizeof(completion));
+       ret = __xn_safe_copy_to_user(u_completion, &completion, 
sizeof(completion));
+       (void)ret;
        pid = completion.pid;
 
        up(&completion_mutex);
@@ -1966,7 +1967,7 @@ static int xnshadow_sys_completion(struct pt_regs *regs)
 {
        xncompletion_t __user *u_completion;
        xncompletion_t completion;
-       int discarded;
+       int ret;
 
        u_completion = (xncompletion_t __user *)__xn_reg_arg1(regs);
 
@@ -1996,8 +1997,8 @@ static int xnshadow_sys_completion(struct pt_regs *regs)
 
                if (signal_pending(current)) {
                        completion.pid = -1;
-                       discarded = __xn_safe_copy_to_user(u_completion, 
&completion, sizeof(completion));
-                       return -ERESTARTSYS;
+                       ret = __xn_safe_copy_to_user(u_completion, &completion, 
sizeof(completion));
+                       return ret ? -EFAULT : -ERESTARTSYS;
                }
        }
 
@@ -2598,13 +2599,12 @@ RTHAL_DECLARE_EXIT_EVENT(taskexit_event);
 static inline void do_schedule_event(struct task_struct *next_task)
 {
        struct task_struct *prev_task;
-       struct xnthread *prev, *next;
+       struct xnthread *next;
 
        if (!xnpod_active_p())
                return;
 
        prev_task = current;
-       prev = xnshadow_thread(prev_task);
        next = xnshadow_thread(next_task);
        set_switch_lock_owner(prev_task);
 
diff --git a/ksrc/nucleus/timebase.c b/ksrc/nucleus/timebase.c
index 0648499..abf153a 100644
--- a/ksrc/nucleus/timebase.c
+++ b/ksrc/nucleus/timebase.c
@@ -585,9 +585,9 @@ EXPORT_SYMBOL_GPL(xntbase_convert);
 
 void xntbase_adjust_time(xntbase_t *base, xnsticks_t delta)
 {
+#ifdef CONFIG_XENO_OPT_TIMING_PERIODIC
        xnticks_t now;
 
-#ifdef CONFIG_XENO_OPT_TIMING_PERIODIC
        if (xntbase_isolated_p(base)) {
                /* Only update the specified isolated base. */
                base->wallclock_offset += delta;
@@ -599,10 +599,10 @@ void xntbase_adjust_time(xntbase_t *base, xnsticks_t 
delta)
 #endif /* CONFIG_XENO_OPT_TIMING_PERIODIC */
                /* Update all non-isolated bases in the system. */
                nktbase.wallclock_offset += xntbase_ticks2ns(base, delta);
-               now = xnarch_get_cpu_time() + nktbase.wallclock_offset;
                xntimer_adjust_all_aperiodic(xntbase_ticks2ns(base, delta));
 
 #ifdef CONFIG_XENO_OPT_TIMING_PERIODIC
+               now = xnarch_get_cpu_time() + nktbase.wallclock_offset;
                for (holder = getheadq(&nktimebaseq);
                     holder != NULL; holder = nextq(&nktimebaseq, holder)) {
                        xntbase_t *tbase = link2tbase(holder);
diff --git a/ksrc/skins/posix/mq.c b/ksrc/skins/posix/mq.c
index 2090d78..f665ecb 100644
--- a/ksrc/skins/posix/mq.c
+++ b/ksrc/skins/posix/mq.c
@@ -268,7 +268,7 @@ mqd_t mq_open(const char *name, int oflags, ...)
        }
 
        va_start(ap, oflags);
-       mode = va_arg(ap, int); /* unused */
+       mode = va_arg(ap, int); (void)mode; /* unused */
        attr = va_arg(ap, struct mq_attr *);
        va_end(ap);
 
diff --git a/ksrc/skins/posix/sem.c b/ksrc/skins/posix/sem.c
index 6f21a31..3a57cb0 100644
--- a/ksrc/skins/posix/sem.c
+++ b/ksrc/skins/posix/sem.c
@@ -317,7 +317,7 @@ sem_t *sem_open(const char *name, int oflags, ...)
        named_sem->descriptor.shadow_sem.sem = &named_sem->sembase;
 
        va_start(ap, oflags);
-       mode = va_arg(ap, int); /* unused */
+       mode = va_arg(ap, int); (void)mode; /* unused */
        value = va_arg(ap, unsigned);
        va_end(ap);
 
diff --git a/ksrc/skins/posix/signal.c b/ksrc/skins/posix/signal.c
index dc5ee9c..f22ca3e 100644
--- a/ksrc/skins/posix/signal.c
+++ b/ksrc/skins/posix/signal.c
@@ -1099,6 +1099,7 @@ static void pse51_dispatch_shadow_signals(xnsigmask_t 
sigs)
           Linux. */
        xnshadow_relax(1, SIGDEBUG_MIGRATE_SIGNAL);
        xnlock_get_irqsave(&nklock, dummy);
+       (void)dummy;
 }
 
 void pse51_signal_handle_request(pthread_t thread)
diff --git a/ksrc/skins/posix/thread.c b/ksrc/skins/posix/thread.c
index 96485bc..01fc699 100644
--- a/ksrc/skins/posix/thread.c
+++ b/ksrc/skins/posix/thread.c
@@ -381,6 +381,7 @@ void pthread_exit(void *value_ptr)
 
        xnlock_get_irqsave(&nklock, s);
        pse51_thread_abort(cur, value_ptr);
+       (void)s;
 }
 
 /**
@@ -494,6 +495,7 @@ int pthread_join(pthread_t thread, void **value_ptr)
                        schedule_timeout_interruptible(HZ/100);
 
                        xnlock_get_irqsave(&nklock, ignored);
+                       (void)ignored;
 
                        if (thread->nrt_joiners == -1) {
                                /* Another thread detached the target thread. */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to