lkml.org 
[lkml]   [2009]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] SCHED_EDF scheduling class
From
Date
On Tue, 2009-09-29 at 20:15 +0200, roel kluin wrote:
> shouldn't the NULL test be moved upwards, to prevent a dereference of
> a NULL pointer?
I definitely think you _do_ are right, many thanks! :-P

> Also I notice that `timespec_to_ns(&param_ex->sched_period)'
> is called twice, maybe gcc does this but can't we do something like
>
> if (edf_policy(policy)) {
> if (param_ex == NULL || param_ex->sched_priority != 0)
> return -EINVAL;
> s64 psp = timespec_to_ns(&param_ex->sched_period);
> if (psp == 0 || psp < timespec_to_ns(&param_ex->sched_runtime))
> return -EINVAL;
> }
>
Well, don't know... I guess the compiler do _something_ (also since
timespec_to_ns is 'static inline') but, to be sincere, I've not looked
at the assembly yet... But I may check it out, at least for x86, and
then consider this. :)

Thanks very much for your comments and suggestions,
Dario

--
<<This happens because I choose it to happen!>> (Raistlin Majere)
----------------------------------------------------------------------
Dario Faggioli, ReTiS Lab, Scuola Superiore Sant'Anna, Pisa (Italy)
http://blog.linux.it/raistlin / raistlin@ekiga.net /
dario.faggioli@jabber.org
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2009-09-30 18:01    [from the cache]
©2003-2011 Jasper Spaans