rbtree: include linux/compiler.h for definition of __always_inline
PATCH 1/1 rbtree: include linux/compiler.h for definition of __always_inline
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.
--- include/linux/rbtree_augmented.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/rbtree_augmented.h +1 -0
@@ -24,6 +24,7 @@#ifndef _LINUX_RBTREE_AUGMENTED_H#define _LINUX_RBTREE_AUGMENTED_H +#include <linux/compiler.h> #include <linux/rbtree.h> /*
Signature · 1 line
1.7.4.1
Quoted 6 lines · Will Deacon
rb_erase_augmentedis 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’
Quoted 7 lines
This patch includes
linux/compiler.hinrbtree_augmented.hso that the__always_inlinemacro is resolved correctly.Cc Pekka Enberg <[email protected]>Cc Michel Lespinasse <[email protected]>Cc Ingo Molnar <[email protected]>Signed-off-by Will Deacon <[email protected]>
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).
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 :)
Signature · 2 lines
Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.
Quoted 15 lines · Michel Lespinasse
Quoted 6 lines · Will Deacon
rb_erase_augmentedis 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’
Quoted 7 lines
This patch includes
linux/compiler.hinrbtree_augmented.hso that the__always_inlinemacro is resolved correctly.Cc Pekka Enberg <[email protected]>Cc Michel Lespinasse <[email protected]>Cc Ingo Molnar <[email protected]>Signed-off-by Will Deacon <[email protected]>
Quoted 6 lines
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.
Quoted 5 lines
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 <[email protected]>
Thanks Michel!
Will
Quoted 19 lines · Will Deacon
Quoted 18 lines · Michel Lespinasse
Quoted 6 lines · Will Deacon
rb_erase_augmentedis 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???
Quoted 7 lines
This patch includes
linux/compiler.hinrbtree_augmented.hso that the__always_inlinemacro is resolved correctly.Cc Pekka Enberg <[email protected]>Cc Michel Lespinasse <[email protected]>Cc Ingo Molnar <[email protected]>Signed-off-by Will Deacon <[email protected]>Just curious - what are you going to implement with augmented rbtrees in kvm tool ?
Quoted 7 lines
Quoted 3 lines
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.
Yeah, latest kvmtool uses the modern augmented-rbtree facility of the kernel.
Thanks,
Ingo