Skip to content

Commit 4f0a8fe

Browse files
committed
Merge tag 'fixes-2024-04-08' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
Pull memblock fixes from Mike Rapoport: "Fix build errors in memblock tests: - add stubs to functions that calls to them were recently added to memblock but they were missing in tests - update gfp_types.h to include bits.h so that BIT() definitions won't depend on other includes" * tag 'fixes-2024-04-08' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock tests: fix undefined reference to `BIT' memblock tests: fix undefined reference to `panic' memblock tests: fix undefined reference to `early_pfn_to_nid'
2 parents fec50db + 592447f commit 4f0a8fe

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

include/linux/gfp_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef __LINUX_GFP_TYPES_H
33
#define __LINUX_GFP_TYPES_H
44

5+
#include <linux/bits.h>
6+
57
/* The typedef is in types.h but we want the documentation here */
68
#if 0
79
/**

tools/include/linux/kernel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/build_bug.h>
99
#include <linux/compiler.h>
1010
#include <linux/math.h>
11+
#include <linux/panic.h>
1112
#include <endian.h>
1213
#include <byteswap.h>
1314

tools/include/linux/mm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@ static inline void totalram_pages_add(long count)
3737
{
3838
}
3939

40+
static inline int early_pfn_to_nid(unsigned long pfn)
41+
{
42+
return 0;
43+
}
44+
4045
#endif

tools/include/linux/panic.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _TOOLS_LINUX_PANIC_H
3+
#define _TOOLS_LINUX_PANIC_H
4+
5+
#include <stdarg.h>
6+
#include <stdio.h>
7+
#include <stdlib.h>
8+
9+
static inline void panic(const char *fmt, ...)
10+
{
11+
va_list argp;
12+
13+
va_start(argp, fmt);
14+
vfprintf(stderr, fmt, argp);
15+
va_end(argp);
16+
exit(-1);
17+
}
18+
19+
#endif

0 commit comments

Comments
 (0)