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

Stewart Smith stewart at linux.ibm.com
Thu Nov 29 15:28:29 AEDT 2018


Again, this makes things look slightly different so I don't keep seeing
the static analysis warning.

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

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);
-- 
2.19.2



More information about the Skiboot mailing list