This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d3962272c7 mm/tlsf: Build mm_lock_irq() only where the delay list 
uses it.
9d3962272c7 is described below

commit 9d3962272c749bbdb46af8a5ff886d57a6273a4b
Author: Marco Casaroli <[email protected]>
AuthorDate: Fri Oct 30 18:05:24 2026 +0100

    mm/tlsf: Build mm_lock_irq() only where the delay list uses it.
    
    add_delaylist() and free_delaylist() call mm_lock_irq() and
    mm_unlock_irq() only in a flat build or in kernel code.  The user-space
    copy of mm_tlsf.c in a protected or kernel build does not use the two
    static functions, so the compiler gives -Wunused-function, and the build
    fails with -Werror (qemu-armv8a:knsh with CONFIG_MM_TLSF_MANAGER).
    
    Put the two functions under the same condition as their callers.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 mm/tlsf/mm_tlsf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/tlsf/mm_tlsf.c b/mm/tlsf/mm_tlsf.c
index 3563fc3ccb3..00ba5cd3443 100644
--- a/mm/tlsf/mm_tlsf.c
+++ b/mm/tlsf/mm_tlsf.c
@@ -185,6 +185,8 @@ static void mm_delayfree(struct mm_heap_s *heap, void *mem, 
bool delay);
  * Private Functions
  ****************************************************************************/
 
+#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
+
 /****************************************************************************
  * Name: mm_lock_irq
  *
@@ -213,6 +215,8 @@ static void mm_unlock_irq(FAR struct mm_heap_s *heap, 
irqstate_t state)
   up_irq_restore(state);
 }
 
+#endif
+
 static void memdump_allocnode(FAR void *ptr, size_t size)
 {
 #if CONFIG_MM_BACKTRACE < 0

Reply via email to