[8/8] hw/bt.c: Move some debug ifdef to make static analysis happy

Message ID 20181129042833.27376-9-stewart@linux.ibm.com
State Accepted
Headers show
Series
  • Random static analysis fixes
Related show

Checks

Context Check Description
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Stewart Smith Nov. 29, 2018, 4:28 a.m.
Okay, so maybe the static analysis warning is all useless, and maybe
having the ifdef around a call is actually useful. I'll take the less
noise in my CI static analysis thing.

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 hw/bt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/bt.c b/hw/bt.c
index 17c6de4ecf58..db214b217efa 100644
--- a/hw/bt.c
+++ b/hw/bt.c
@@ -409,9 +409,9 @@  static void bt_expire_old_msg(uint64_t tb)
 	}
 }
 
+#if BT_QUEUE_DEBUG
 static void print_debug_queue_info(void)
 {
-#if BT_QUEUE_DEBUG
 	struct bt_msg *msg;
 	static bool printed;
 
@@ -426,8 +426,8 @@  static void print_debug_queue_info(void)
 		printed = true;
 		prlog(PR_DEBUG, "----- BT Msg Queue Empty -----\n");
 	}
-#endif
 }
+#endif
 
 static void bt_send_and_unlock(void)
 {
@@ -473,7 +473,9 @@  static void bt_poll(struct timer *t __unused, void *data __unused,
 	 */
 	lock(&bt.lock);
 
+#if BT_QUEUE_DEBUG
 	print_debug_queue_info();
+#endif
 
 	bt_ctrl = bt_inb(BT_CTRL);