Skip to contentSkip to conversation

hrtimer: remove duplicate helper function

PATCH Applied Oliver Hartkopp 2 participants 2 messages Apr 30, 2008

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to Oliver Hartkopp

Oliver,

Quoted 8 lines · Oliver Hartkopp

from Oliver Hartkopp <[email protected]>

The helper function hrtimer_callback_running() is used in kernel/hrtimer.c as well as in the updated net/can/bcm.c which now supports hrtimers. Moving the helper function to hrtimer.h removes the duplicate definition in the C-files.

Applied. Thanks,

tglx

#0 lore raw

PATCH 1/1 hrtimer: remove duplicate helper function

from Oliver Hartkopp <[email protected]>

The helper function hrtimer_callback_running() is used in kernel/hrtimer.c as well as in the updated net/can/bcm.c which now supports hrtimers. Moving the helper function to hrtimer.h removes the duplicate definition in the C-files.

---

Hello Thomas,

as discussed on the OSADL workshop here is the removal of my duplicate definition of your helper function in net/can/bcm.c .

The patch applies fine on Linus' current tree for the 2.6.26 merge.

Thanks & best regards,
Oliver

include/linux/hrtimer.h +9 -0
index 31a4d65..6d93dce 100644
@@ -316,6 +316,15 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
 		(HRTIMER_STATE_ENQUEUED | HRTIMER_STATE_PENDING);
 }
 
+/*
+ * Helper function to check, whether the timer is running the callback
+ * function
+ */
+static inline int hrtimer_callback_running(struct hrtimer *timer)
+{
+	return timer->state & HRTIMER_STATE_CALLBACK;
+}
+
 /* Forward a hrtimer so it expires after now: */
 extern u64
 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
kernel/hrtimer.c +0 -9
index 9af1d6a..421be5f 100644
@@ -154,15 +154,6 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
 }
 
 /*
- * Helper function to check, whether the timer is running the callback
- * function
- */
-static inline int hrtimer_callback_running(struct hrtimer *timer)
-{
-	return timer->state & HRTIMER_STATE_CALLBACK;
-}
-
-/*
  * Functions and macros which are different for UP/SMP systems are kept in a
  * single place
  */
net/can/bcm.c +0 -6
index 74fd2d3..d9a3a9d 100644
@@ -412,12 +412,6 @@ static void bcm_rx_changed(struct bcm_op *op, struct can_frame *data)
 	bcm_send_to_user(op, &head, data, 1);
 }
 
-/* TODO: move to linux/hrtimer.h */
-static inline int hrtimer_callback_running(struct hrtimer *timer)
-{
-        return timer->state & HRTIMER_STATE_CALLBACK;
-}
-
 /*
  * bcm_rx_update_and_send - process a detected relevant receive content change
  *                          1. update the last received data