Skip to content

Commit

Permalink
memblock tests: Fix mutex related build error
Browse files Browse the repository at this point in the history
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 <richard.weiyang@gmail.com>
Closes: https://lore.kernel.org/all/20250405023018.g2ae52nrz2757b3n@master/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/174399023133.47537.7375975856054461445.stgit@devnote2
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
  • Loading branch information
Masami Hiramatsu (Google) authored and Mike Rapoport (Microsoft) committed Apr 7, 2025
1 parent 0af2f6b commit ed471e1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/testing/memblock/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,10 @@ static inline void accept_memory(phys_addr_t start, unsigned long size)
{
}

static inline unsigned long free_reserved_area(void *start, void *end,
int poison, const char *s)
{
return 0;
}

#endif
14 changes: 14 additions & 0 deletions tools/testing/memblock/linux/mutex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _MUTEX_H
#define _MUTEX_H

#define DEFINE_MUTEX(name) int name

static inline void dummy_mutex_guard(int *name)
{
}

#define guard(mutex) \
dummy_##mutex##_guard

#endif /* _MUTEX_H */

0 comments on commit ed471e1

Please sign in to comment.