Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys - since we include asan.h unconditionally now, make ...



details:   https://anonhg.NetBSD.org/src/rev/cd808d5672ed
branches:  trunk
changeset: 834663:cd808d5672ed
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Aug 22 14:11:26 2018 +0000

description:
- since we include asan.h unconditionally now, make sure opt_kasan.h is
  included here, following the practice from other header files.
- don't use inline functions, adds complexity (and broke the build)

diffstat:

 sys/sys/asan.h |  27 ++++++++-------------------
 1 files changed, 8 insertions(+), 19 deletions(-)

diffs (48 lines):

diff -r 03e8c94d7968 -r cd808d5672ed sys/sys/asan.h
--- a/sys/sys/asan.h    Wed Aug 22 13:16:41 2018 +0000
+++ b/sys/sys/asan.h    Wed Aug 22 14:11:26 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asan.h,v 1.6 2018/08/22 12:42:06 maxv Exp $    */
+/*     $NetBSD: asan.h,v 1.7 2018/08/22 14:11:26 christos Exp $        */
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,6 +32,10 @@
 #ifndef _SYS_ASAN_H_
 #define _SYS_ASAN_H_
 
+#ifdef _KERNEL_OPT
+#include "opt_kasan.h"
+#endif
+
 #include <sys/types.h>
 
 #ifdef KASAN
@@ -39,24 +43,9 @@
 void kasan_alloc(const void *, size_t, size_t);
 void kasan_free(const void *, size_t);
 #else
-__inline static void __unused
-kasan_add_redzone(size_t *size __unused)
-{
-       /* nothing */
-}
-
-__inline static void __unused
-kasan_alloc(const void *addr __unused, size_t size __unused,
-    size_t sz_with_redz __unused)
-{
-       /* nothing */
-}
-
-__inline static void __unused
-kasan_free(const void *addr __unused, size_t sz_with_redz __unused)
-{
-       /* nothing */
-}
+#define kasan_add_redzone(s)   __nothing
+#define kasan_alloc(p, s, l)   __nothing
+#define kasan_free(p, s)       __nothing
 #endif
 
 #endif /* !_SYS_ASAN_H_ */



Home | Main Index | Thread Index | Old Index