Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools: add WARN_ON_ONCE

Patch series "Radix tree patches for 4.10", v3.

Mostly these are improvements; the only bug fixes in here relate to
multiorder entries (which are unused in the 4.9 tree).

This patch (of 32):

The radix tree uses its own buggy WARN_ON_ONCE. Replace it with the
definition from asm-generic/bug.h

Link: http://lkml.kernel.org/r/1480369871-5271-37-git-send-email-mawilcox@linuxonhyperv.com
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Matthew Wilcox and committed by
Linus Torvalds
ebb9a9ae 4b4bb46d

+13 -4
+11
tools/include/asm/bug.h
··· 12 12 unlikely(__ret_warn_on); \ 13 13 }) 14 14 15 + #define WARN_ON_ONCE(condition) ({ \ 16 + static int __warned; \ 17 + int __ret_warn_once = !!(condition); \ 18 + \ 19 + if (unlikely(__ret_warn_once && !__warned)) { \ 20 + __warned = true; \ 21 + WARN_ON(1); \ 22 + } \ 23 + unlikely(__ret_warn_once); \ 24 + }) 25 + 15 26 #define WARN_ONCE(condition, format...) ({ \ 16 27 static int __warned; \ 17 28 int __ret_warn_once = !!(condition); \
+1 -1
tools/testing/radix-tree/Makefile
··· 1 1 2 - CFLAGS += -I. -g -O2 -Wall -D_LGPL_SOURCE 2 + CFLAGS += -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE 3 3 LDFLAGS += -lpthread -lurcu 4 4 TARGETS = main 5 5 OFILES = main.o radix-tree.o linux.o test.o tag_check.o find_next_bit.o \
+1 -1
tools/testing/radix-tree/linux/bug.h
··· 1 - #define WARN_ON_ONCE(x) assert(x) 1 + #include "asm/bug.h"
-2
tools/testing/radix-tree/linux/types.h
··· 6 6 #define __rcu 7 7 #define __read_mostly 8 8 9 - #define BITS_PER_LONG (sizeof(long) * 8) 10 - 11 9 static inline void INIT_LIST_HEAD(struct list_head *list) 12 10 { 13 11 list->next = list;