diff options
| author | Wei Yang <richard.weiyang@gmail.com> | 2024-04-02 16:27:00 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-17 12:56:06 +0300 |
| commit | 223550f0e91011cd18dfb0834b448a306b9b6e79 (patch) | |
| tree | 960822d364e2db3c76e528b7bd4fc268b90181ef /tools/include/linux/panic.h | |
| parent | 701248485be3e109ce88845b0833df6f70840ea9 (diff) | |
| download | linux-223550f0e91011cd18dfb0834b448a306b9b6e79.tar.xz | |
memblock tests: fix undefined reference to `panic'
[ Upstream commit e0f5a8e74be88f2476e58b25d3b49a9521bdc4ec ]
commit e96c6b8f212a ("memblock: report failures when memblock_can_resize
is not set") introduced the usage of panic, which is not defined in
memblock test.
Let's define it directly in panic.h to fix it.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Song Shuai <songshuaishuai@tinylab.org>
CC: Mike Rapoport <rppt@kernel.org>
Link: https://lore.kernel.org/r/20240402132701.29744-3-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/include/linux/panic.h')
| -rw-r--r-- | tools/include/linux/panic.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/include/linux/panic.h b/tools/include/linux/panic.h new file mode 100644 index 000000000000..9c8f17a41ce8 --- /dev/null +++ b/tools/include/linux/panic.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _TOOLS_LINUX_PANIC_H +#define _TOOLS_LINUX_PANIC_H + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> + +static inline void panic(const char *fmt, ...) +{ + va_list argp; + + va_start(argp, fmt); + vfprintf(stderr, fmt, argp); + va_end(argp); + exit(-1); +} + +#endif |
