rbtree: avoid generating code twice for the cached versions (tools copy)
authorMichel Lespinasse <walken@google.com>
Wed, 25 Sep 2019 23:46:02 +0000 (16:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 26 Sep 2019 00:51:39 +0000 (17:51 -0700)
commitc7d4f7eeb6da9408e9ba7475fe2624bdb4d837d0
treec5ffd56e31d863a0970be1b1499fc761ec1fc43c
parent0f74914071ab7e7b78731ed62bf350e3a344e0a5
rbtree: avoid generating code twice for the cached versions (tools copy)

As was already noted in rbtree.h, the logic to cache rb_first (or
rb_last) can easily be implemented externally to the core rbtree api.

This commit takes the changes applied to the include/linux/ and lib/
rbtree files in 9f973cb38088 ("lib/rbtree: avoid generating code twice
for the cached versions"), and applies these to the
tools/include/linux/ and tools/lib/ files as well to keep them
synchronized.

Link: http://lkml.kernel.org/r/20190703034812.53002-1-walken@google.com
Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/include/linux/rbtree.h
tools/include/linux/rbtree_augmented.h
tools/lib/rbtree.c