Wed Aug 22 10:09:22 2018 UTC ()
Actually add __unused on the functions themselves in case a .c file does
not use one function.


(maxv)
diff -r1.2 -r1.3 src/sys/sys/asan.h

cvs diff -r1.2 -r1.3 src/sys/sys/asan.h (expand / switch to unified diff)

--- src/sys/sys/asan.h 2018/08/22 09:38:21 1.2
+++ src/sys/sys/asan.h 2018/08/22 10:09:21 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: asan.h,v 1.2 2018/08/22 09:38:21 maxv Exp $ */ 1/* $NetBSD: asan.h,v 1.3 2018/08/22 10:09:21 maxv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2018 The NetBSD Foundation, Inc. 4 * Copyright (c) 2018 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Maxime Villard. 8 * by Maxime Villard.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -29,34 +29,34 @@ @@ -29,34 +29,34 @@
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _SYS_ASAN_H_ 32#ifndef _SYS_ASAN_H_
33#define _SYS_ASAN_H_ 33#define _SYS_ASAN_H_
34 34
35#include <sys/types.h> 35#include <sys/types.h>
36 36
37#ifdef KASAN 37#ifdef KASAN
38void kasan_add_redzone(size_t *); 38void kasan_add_redzone(size_t *);
39void kasan_alloc(const void *, size_t, size_t); 39void kasan_alloc(const void *, size_t, size_t);
40void kasan_free(const void *, size_t); 40void kasan_free(const void *, size_t);
41#else 41#else
42static void __always_inline 42static void __always_inline __unused
43kasan_add_redzone(size_t *size __unused) 43kasan_add_redzone(size_t *size __unused)
44{ 44{
45 /* nothing */ 45 /* nothing */
46} 46}
47 47
48static void __always_inline 48static void __always_inline __unused
49kasan_alloc(const void *addr __unused, size_t size __unused, 49kasan_alloc(const void *addr __unused, size_t size __unused,
50 size_t sz_with_redz __unused) 50 size_t sz_with_redz __unused)
51{ 51{
52 /* nothing */ 52 /* nothing */
53} 53}
54 54
55static void __always_inline 55static void __always_inline __unused
56kasan_free(const void *addr __unused, size_t sz_with_redz __unused) 56kasan_free(const void *addr __unused, size_t sz_with_redz __unused)
57{ 57{
58 /* nothing */ 58 /* nothing */
59} 59}
60#endif 60#endif
61 61
62#endif /* !_SYS_ASAN_H_ */ 62#endif /* !_SYS_ASAN_H_ */