2011-02-01 13:52:30

by Thomas Gleixner

[permalink] [raw]
Subject: [patch 19/28] posix-timers: Remove CLOCK_DISPATCH leftovers

All users gone. Remove the cruft.

Signed-off-by: Thomas Gleixner <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Richard Cochran <[email protected]>
---
kernel/posix-timers.c | 22 ----------------------
1 file changed, 22 deletions(-)

Index: linux-2.6-tip/kernel/posix-timers.c
===================================================================
--- linux-2.6-tip.orig/kernel/posix-timers.c
+++ linux-2.6-tip/kernel/posix-timers.c
@@ -167,28 +167,6 @@ static inline void unlock_timer(struct k
spin_unlock_irqrestore(&timr->it_lock, flags);
}

-/*
- * Call the k_clock hook function if non-null, or the default function.
- */
-#define CLOCK_DISPATCH(clock, call, arglist) \
- ((clock) < 0 ? posix_cpu_##call arglist : \
- (posix_clocks[clock].call != NULL \
- ? (*posix_clocks[clock].call) arglist : common_##call arglist))
-
-/*
- * Return nonzero if we know a priori this clockid_t value is bogus.
- */
-static inline int invalid_clockid(const clockid_t which_clock)
-{
- if (which_clock < 0) /* CPU clock, posix_cpu_* will check it */
- return 0;
- if ((unsigned) which_clock >= MAX_CLOCKS)
- return 1;
- if (posix_clocks[which_clock].clock_getres != NULL)
- return 0;
- return 1;
-}
-
/* Get clock_realtime */
static int posix_clock_realtime_get(clockid_t which_clock, struct timespec *tp)
{


2011-02-01 21:26:07

by john stultz

[permalink] [raw]
Subject: Re: [patch 19/28] posix-timers: Remove CLOCK_DISPATCH leftovers

On Tue, 2011-02-01 at 13:52 +0000, Thomas Gleixner wrote:
> plain text document attachment
> (posix-timers-remove-clock-dispatch-leftovers.patch)
> All users gone. Remove the cruft.
>
> Signed-off-by: Thomas Gleixner <[email protected]>
> Cc: John Stultz <[email protected]>
> Cc: Richard Cochran <[email protected]>
> ---
> kernel/posix-timers.c | 22 ----------------------
> 1 file changed, 22 deletions(-)
>
> Index: linux-2.6-tip/kernel/posix-timers.c
> ===================================================================
> --- linux-2.6-tip.orig/kernel/posix-timers.c
> +++ linux-2.6-tip/kernel/posix-timers.c
> @@ -167,28 +167,6 @@ static inline void unlock_timer(struct k
> spin_unlock_irqrestore(&timr->it_lock, flags);
> }
>
> -/*
> - * Call the k_clock hook function if non-null, or the default function.
> - */
> -#define CLOCK_DISPATCH(clock, call, arglist) \
> - ((clock) < 0 ? posix_cpu_##call arglist : \
> - (posix_clocks[clock].call != NULL \
> - ? (*posix_clocks[clock].call) arglist : common_##call arglist))
> -

Big thanks to Richard and Thomas for killing this bit of ugliness!

Acked-by: John Stultz <[email protected]>

2011-02-02 22:02:52

by Thomas Gleixner

[permalink] [raw]
Subject: [tip:timers/core] posix-timers: Remove CLOCK_DISPATCH leftovers

Commit-ID: 0aa3975f02ce78f27be3076fbfa3d94ae5a659d5
Gitweb: http://git.kernel.org/tip/0aa3975f02ce78f27be3076fbfa3d94ae5a659d5
Author: Thomas Gleixner <[email protected]>
AuthorDate: Tue, 1 Feb 2011 13:52:09 +0000
Committer: Thomas Gleixner <[email protected]>
CommitDate: Wed, 2 Feb 2011 15:28:17 +0100

posix-timers: Remove CLOCK_DISPATCH leftovers

All users gone. Remove the cruft.

Huge thanks to Richard Cochran who tackled that maze first.

Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: John Stultz <[email protected]>
Tested-by: Richard Cochran <[email protected]>
LKML-Reference: <[email protected]>
---
kernel/posix-timers.c | 22 ----------------------
1 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index ade7dec..ad154df 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -167,28 +167,6 @@ static inline void unlock_timer(struct k_itimer *timr, unsigned long flags)
spin_unlock_irqrestore(&timr->it_lock, flags);
}

-/*
- * Call the k_clock hook function if non-null, or the default function.
- */
-#define CLOCK_DISPATCH(clock, call, arglist) \
- ((clock) < 0 ? posix_cpu_##call arglist : \
- (posix_clocks[clock].call != NULL \
- ? (*posix_clocks[clock].call) arglist : common_##call arglist))
-
-/*
- * Return nonzero if we know a priori this clockid_t value is bogus.
- */
-static inline int invalid_clockid(const clockid_t which_clock)
-{
- if (which_clock < 0) /* CPU clock, posix_cpu_* will check it */
- return 0;
- if ((unsigned) which_clock >= MAX_CLOCKS)
- return 1;
- if (posix_clocks[which_clock].clock_getres != NULL)
- return 0;
- return 1;
-}
-
/* Get clock_realtime */
static int posix_clock_realtime_get(clockid_t which_clock, struct timespec *tp)
{