[4/8] opal_trace_entry: Move ifdef around to shut up static analysis

Message ID 20181129042833.27376-5-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.
Again, this makes things look slightly different so I don't keep seeing
the static analysis warning.

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

Patch

diff --git a/core/opal.c b/core/opal.c
index 3a8ea30b79f0..ba30c309ca58 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -93,9 +93,9 @@  long opal_bad_token(uint64_t token)
 	return OPAL_PARAMETER;
 }
 
+#ifdef OPAL_TRACE_ENTRY
 static void opal_trace_entry(struct stack_frame *eframe __unused)
 {
-#ifdef OPAL_TRACE_ENTRY
 	union trace t;
 	unsigned nargs, i;
 
@@ -111,8 +111,8 @@  static void opal_trace_entry(struct stack_frame *eframe __unused)
 		t.opal.r3_to_11[i] = cpu_to_be64(eframe->gpr[3+i]);
 
 	trace_add(&t, TRACE_OPAL, offsetof(struct trace_opal, r3_to_11[nargs]));
-#endif
 }
+#endif
 
 /*
  * opal_quiesce_state is used as a lock. Don't use an actual lock to avoid
@@ -138,7 +138,9 @@  int64_t opal_entry_check(struct stack_frame *eframe)
 		abort();
 	}
 
+#ifdef OPAL_TRACE_ENTRY
 	opal_trace_entry(eframe);
+#endif
 
 	if (!opal_check_token(token))
 		return opal_bad_token(token);