Skip to contentSkip to conversation

hrtimer: Build fix for !KTIME_SCALAR on 32bit.

PATCH New Paul Mundt 1 participant 1 message Sep 11, 2007

lore
Share & tools
lore

Paul Mundt

author
#0 lore raw

PATCH 1/1 hrtimer: Build fix for !KTIME_SCALAR on 32bit.

On BITS_PER_LONG < 64 and !CONFIG_KTIME_SCALAR we get this:

CC kernel/hrtimer.o
kernel/hrtimer.c:303: error: redefinition of '__kstrtab_ktime_add_ns' kernel/hrtimer.c:279: error: previous definition of '__kstrtab_ktime_add_ns' was here kernel/hrtimer.c:303: error: redefinition of '__ksymtab_ktime_add_ns' kernel/hrtimer.c:279: error: previous definition of '__ksymtab_ktime_add_ns' was here kernel/hrtimer.c:313: error: redefinition of 'ktime_sub_ns' kernel/hrtimer.c:289: error: previous definition of 'ktime_sub_ns' was here make[1]: *** [kernel/hrtimer.o] Error 1
make: *** [kernel] Error 2

For some reason the ktime_sub_ns() addition was duplicated, and someone forgot to change the name of the ktime_add_ns() symbol export they lifted.

Get it building again.

--

 kernel/hrtimer.c |   24 ------------------------
 1 file changed, 24 deletions(-)
kernel/hrtimer.c +0 -24
@@ -300,30 +300,6 @@
 	return ktime_sub(kt, tmp);
 }
 
-EXPORT_SYMBOL_GPL(ktime_add_ns);
-
-/**
- * ktime_sub_ns - Subtract a scalar nanoseconds value from a ktime_t variable
- * @kt:		minuend
- * @nsec:	the scalar nsec value to subtract
- *
- * Returns the subtraction of @nsec from @kt in ktime_t format
- */
-ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec)
-{
-	ktime_t tmp;
-
-	if (likely(nsec < NSEC_PER_SEC)) {
-		tmp.tv64 = nsec;
-	} else {
-		unsigned long rem = do_div(nsec, NSEC_PER_SEC);
-
-		tmp = ktime_set((long)nsec, rem);
-	}
-
-	return ktime_sub(kt, tmp);
-}
-
 EXPORT_SYMBOL_GPL(ktime_sub_ns);
 # endif /* !CONFIG_KTIME_SCALAR */