lkml.org 
[lkml]   [2011]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 07/28] posix-timers: Convert clock_nanosleep_restart to clockid_to_kclock()
From
Date
On Tue, 2011-02-01 at 13:51 +0000, Thomas Gleixner wrote:
> plain text document attachment
> (posix-timers-convert-nanosleep-restart.patch)
> Use the new kclock decoding function in clock_nanosleep_restart. No
> need to check kclock here as the restart block always contains a valid
> clockid. If not, we are in serious trouble anyway.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Richard Cochran <richard.cochran@omicron.at>

One nit.

> -long
> -clock_nanosleep_restart(struct restart_block *restart_block)
> +long clock_nanosleep_restart(struct restart_block *restart_block)
> {
> clockid_t which_clock = restart_block->arg0;
> + struct k_clock *kc = clockid_to_kclock(which_clock);
>
> - return CLOCK_DISPATCH(which_clock, nsleep_restart,
> - (restart_block));
> + return kc->nsleep_restart(restart_block);
> }


Should you be checking if kc is null before dereferencing? Or am I being
overly paranoid?

thanks
-john




\
 
 \ /
  Last update: 2011-02-01 21:45    [W:0.493 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site