Skip to content

Commit ed471e1

Browse files
mhiramatrppt
authored andcommitted
memblock tests: Fix mutex related build error
Fix mutex and free_reserved_area() related build errors which have been introduced by commit 74e2498 ("mm/memblock: Add reserved memory release function"). Fixes: 74e2498 ("mm/memblock: Add reserved memory release function") Reported-by: Wei Yang <[email protected]> Closes: https://lore.kernel.org/all/20250405023018.g2ae52nrz2757b3n@master/ Signed-off-by: Masami Hiramatsu (Google) <[email protected]> Link: https://lore.kernel.org/r/174399023133.47537.7375975856054461445.stgit@devnote2 Signed-off-by: Mike Rapoport (Microsoft) <[email protected]>
1 parent 0af2f6b commit ed471e1

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tools/testing/memblock/internal.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@ static inline void accept_memory(phys_addr_t start, unsigned long size)
2424
{
2525
}
2626

27+
static inline unsigned long free_reserved_area(void *start, void *end,
28+
int poison, const char *s)
29+
{
30+
return 0;
31+
}
32+
2733
#endif

tools/testing/memblock/linux/mutex.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _MUTEX_H
3+
#define _MUTEX_H
4+
5+
#define DEFINE_MUTEX(name) int name
6+
7+
static inline void dummy_mutex_guard(int *name)
8+
{
9+
}
10+
11+
#define guard(mutex) \
12+
dummy_##mutex##_guard
13+
14+
#endif /* _MUTEX_H */

0 commit comments

Comments
 (0)