Re: [PATCH] rbtree: include linux/compiler.h for definition of__always_inline

From: Will Deacon
Date: Tue Oct 23 2012 - 05:29:31 EST


On Mon, Oct 22, 2012 at 10:56:21PM +0100, Michel Lespinasse wrote:
> On Mon, Oct 22, 2012 at 10:01 AM, Will Deacon <will.deacon@xxxxxxx> wrote:
> > rb_erase_augmented is a static function annotated with __always_inline.
> > This causes a compile failure when attempting to use the rbtree
> > implementation as a library (e.g. kvm tool):
> >
> > rbtree_augmented.h:125:24: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âvoidâ
> >
> > This patch includes linux/compiler.h in rbtree_augmented.h so that the
> > __always_inline macro is resolved correctly.
> >
> > Cc: Pekka Enberg <penberg@xxxxxxxxxx>
> > Cc: Michel Lespinasse <walken@xxxxxxxxxx>
> > Cc: Ingo Molnar <mingo@xxxxxxx>
> > Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
>
> Just curious - what are you going to implement with augmented rbtrees
> in kvm tool ?
>
> If the basic rbtree or the interval tree implementations are
> sufficient for your usage, you should try using that (in which case
> you won't need this header fix).

kvm tool uses interval rbtrees for things like keeping track of virtual
devices, although it looks like Ingo implemented the augment callbacks
while moving to -rc1.

> But either way, the header fix is correct and will be required when
> someone wants to use augmented rbtrees outside of the kernel. I just
> didn't think that day would come so fast :)
>
> Reviewed-by: Michel Lespinasse <walken@xxxxxxxxxx>

Thanks Michel!

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/