Skip to contentSkip to conversation

memblock tests: Fix mutex related build error

PATCH Applied Masami Hiramatsu (Google) 2 participants 2 messages Apr 7, 2025

Subsystems (3)
lore
Share & tools
lore

Masami Hiramatsu (Google)

author maintainer
#0 lore raw

PATCH 1/1 memblock tests: Fix mutex related build error

From: Masami Hiramatsu (Google) <[email protected]>

Fix mutex and free_reserved_area() related build errors which have been introduced by commit 74e2498ccf7b ("mm/memblock: Add reserved memory release function").

Fixes 74e2498ccf7b ("mm/memblock: Add reserved memory release function")
---
 tools/testing/memblock/internal.h    |    6 ++++++
 tools/testing/memblock/linux/mutex.h |   14 ++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 tools/testing/memblock/linux/mutex.h
tools/testing/memblock/internal.h +6 -0
index 1cf82acb2a3e..0ab4b53bb4f3 100644
@@ -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
tools/testing/memblock/linux/mutex.h new file +14 -0
new file mode 100644
index 000000000000..ae3f497165d6
@@ -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 */
\ No newline at end of file
maintainer Applied
#1 lore raw
Quoted 5 lines · Masami Hiramatsu (Google)

Fix mutex and free_reserved_area() related build errors which have been introduced by commit 74e2498ccf7b ("mm/memblock: Add reserved memory release function").

Applied to fixes branch of memblock.git tree, thanks!

[1/1] memblock tests: Fix mutex related build error

      commit: ed471e1984939a500eea179bc16e1c2aadf00db5

tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
branch: fixes

--
Sincerely yours,
Mike.