On Mon, 2019-05-06 at 08:56 +0200, Juergen Gross wrote: > Instead of using the SCHED_OP() macro to call the different scheduler > specific functions add inline wrappers for that purpose. > > Signed-off-by: Juergen Gross <[email protected]>
> @@ -207,6 +250,141 @@ static inline void sched_free_domdata(const
> struct scheduler *s,
> ASSERT(!data);
> }
>
> +static inline void *sched_alloc_pdata(const struct scheduler *s, int
> cpu)
> +{
> + if ( s->alloc_pdata )
> + return s->alloc_pdata(s, cpu);
> + else
> + return NULL;
> +}
>
I agree with Jan about getting rid of the 'else' in cases like these.
And, possibly, here too:
> +static inline void sched_free_pdata(const struct scheduler *s, void
> *data,
> + int cpu)
> +{
> + if ( s->free_pdata )
> + s->free_pdata(s, data, cpu);
> + else
> + /*
> + * Check that if there isn't a free_pdata hook, we haven't
> got any
> + * data we're expected to deal with.
> + */
> + ASSERT(!data);
> +}
>
Doing, maybe ASSERT(s->free_pdata || !data) as a first thing in the
function.
Regards
--
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
