]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: ti: knav_qmss: Inline lockdep condition in for_each_handle_rcu
authorNishanth Menon <nm@ti.com>
Tue, 12 May 2026 17:06:15 +0000 (12:06 -0500)
committerNishanth Menon <nm@ti.com>
Fri, 22 May 2026 15:55:55 +0000 (10:55 -0500)
knav_dev_lock_held() is a single-use wrapper around
lockdep_is_held(&knav_dev_lock), used only as the lockdep condition
in for_each_handle_rcu. When CONFIG_PROVE_RCU_LIST is disabled,
list_for_each_entry_rcu() elides the condition argument entirely,
causing clang to report the macro as unused with W=2:

  knav_qmss_queue.c:30:9: warning: macro is not used [-Wunused-macros]
  30 | #define knav_dev_lock_held() \

Remove the intermediate macro and open-code lockdep_is_held() directly
in the for_each_handle_rcu definition.

Reviewed-by: Andrew Davis <afd@ti.com>
Reviewed-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
Reviewed-by: Hari Prasath Gujulan Elango <gehariprasath@ti.com>
Link: https://patch.msgid.link/20260512170623.3174416-4-nm@ti.com
Signed-off-by: Nishanth Menon <nm@ti.com>
drivers/soc/ti/knav_qmss_queue.c

index 52a30abb2caf6a892d480209bcd8990fd3b1c530..68c55134ad6cb6e06e8b447d779ee44b07b833c5 100644 (file)
@@ -27,9 +27,6 @@
 
 static struct knav_device *knav_qdev;
 static DEFINE_MUTEX(knav_dev_lock);
-#define knav_dev_lock_held() \
-       lockdep_is_held(&knav_dev_lock)
-
 /* Queue manager register indices in DTS */
 #define KNAV_QUEUE_PEEK_REG_INDEX      0
 #define KNAV_QUEUE_STATUS_REG_INDEX    1
@@ -58,7 +55,7 @@ static DEFINE_MUTEX(knav_dev_lock);
 
 #define for_each_handle_rcu(qh, inst)                          \
        list_for_each_entry_rcu(qh, &inst->handles, list,       \
-                               knav_dev_lock_held())
+                               lockdep_is_held(&knav_dev_lock))
 
 #define for_each_instance(idx, inst, kdev)             \
        for (idx = 0, inst = kdev->instances;           \