Messages in this thread | | | Subject | Re: [RFC][PATCH] SCHED_EDF scheduling class | From | Raistlin <> | Date | Wed, 30 Sep 2009 17:59:02 +0200 |
| |
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(¶m_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(¶m_ex->sched_period); > if (psp == 0 || psp < timespec_to_ns(¶m_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] | |