[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC V2 01/45] xen/sched: add inline wrappers for calling per-scheduler functions
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 <jgross@xxxxxxxx> > @@ -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) Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |