Skip to contentSkip to conversation

kernel/hrtimer.c(511): remark #593: variable "base" was set but never used

PATCH In review d binderman 3 participants 3 messages Nov 23, 2006 – Dec 12, 2006

lore
Share & tools
lore
#0 lore raw

Hello there,

I just tried to compile Linux kernel 2.6.18.3 with the Intel C C compiler.

The compiler said

kernel/hrtimer.c(511): remark #593: variable "base" was set but never used

The source code is

struct hrtimer_base *base;

I have checked the source code and I agree with the compiler. Suggest delete local variable.

Regards

David Binderman

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters

#1 lore raw

PATCH 1/1 hrtimer: remove unused variable

Remove unused 'base' variable.

---
 kernel/hrtimer.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
kernel/hrtimer.c +1 -2
index d0ba190..b55532f 100644
@@ -508,11 +508,10 @@ EXPORT_SYMBOL_GPL(hrtimer_cancel);
  */
 ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
 {
-	struct hrtimer_base *base;
 	unsigned long flags;
 	ktime_t rem;
 
-	base = lock_hrtimer_base(timer, &flags);
+	lock_hrtimer_base(timer, &flags);
 	rem = ktime_sub(timer->expires, timer->base->get_time());
 	unlock_hrtimer_base(timer, &flags);
 
#2 lore raw

Re: [PATCH] hrtimer: remove unused variable

Quoted 2 lines · David Rientjes

Remove unused 'base' variable.

Or just use it.

kernel/hrtimer.c +1 -1
Index: linux-2.6.19/kernel/hrtimer.c
===================================================================
@@ -513,7 +513,7 @@ ktime_t hrtimer_get_remaining(const stru
 	ktime_t rem;
 
 	base = lock_hrtimer_base(timer, &flags);
-	rem = ktime_sub(timer->expires, timer->base->get_time());
+	rem = ktime_sub(timer->expires, base->get_time());
 	unlock_hrtimer_base(timer, &flags);
 
 	return rem;