[Skiboot] [PATCH 1/1] buddy: Fix warnings when undefining BUDDY_DEBUG

Ryan Grimm grimm at linux.ibm.com
Fri May 22 05:22:01 AEST 2020


In simulation, hundreds of millions of cycles are chewed up in this code
path:

PC: 0x0000000030033450 -> <.bitmap_tst_bit>+0x18
LR: 0x000000003003347c -> <.buddy_check_alloc>+0x14
    0x0000000031c13b30 -> <_ebss>+0x1803b30
    0x000000003003351c -> <.buddy_check_alloc_down>+0x4c
    0x00000000300339c4 -> <.buddy_free>+0x7c
    0x0000000030033be8 -> <.buddy_create>+0xcc
    0x0000000030089bbc -> <.xive_init>+0xf0
    0x00000000300157cc -> <.main_cpu_entry>+0x8a0
    0x000000003000275c -> <boot_entry>+0x1bc

Undefining BUDDY_DEBUG saves 30+ minutes of wall clock time, so fix
the "warning: unused parameter" messages when compiling.

Signed-off-by: Ryan Grimm <grimm at linux.ibm.com>
---
 core/buddy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/buddy.c b/core/buddy.c
index 1f433dd6..b36e407d 100644
--- a/core/buddy.c
+++ b/core/buddy.c
@@ -70,8 +70,8 @@ static void buddy_check_alloc_down(struct buddy *b, unsigned int node)
 	}
 }
 #else
-static inline void buddy_check_alloc(struct buddy *b, unsigned int node) {}
-static inline void buddy_check_alloc_down(struct buddy *b, unsigned int node) {}
+static inline void buddy_check_alloc(struct buddy *b __unused, unsigned int node __unused) {}
+static inline void buddy_check_alloc_down(struct buddy *b __unused, unsigned int node __unused) {}
 #endif
 
 int buddy_alloc(struct buddy *b, unsigned int order)
-- 
2.21.0



More information about the Skiboot mailing list