[Skiboot] [PATCH v2 04/16] external/trace: Use correct width integer byte swapping

Jordan Niethe jniethe5 at gmail.com
Tue Apr 2 10:43:15 AEDT 2019


The trace_repeat struct uses be16 for storing the number of repeats.
Currently be32_to_cpu conversion is used to display this member. This
produces an incorrect value. Use be16_to_cpu instead.

Signed-off-by: Jordan Niethe <jniethe5 at gmail.com>
---
 external/trace/dump_trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/external/trace/dump_trace.c b/external/trace/dump_trace.c
index db53d785be57..4779dc42ec6d 100644
--- a/external/trace/dump_trace.c
+++ b/external/trace/dump_trace.c
@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
 		switch (t.hdr.type) {
 		case TRACE_REPEAT:
 			printf("REPEATS: %u times\n",
-			       be32_to_cpu(t.repeat.num));
+			       be16_to_cpu(t.repeat.num));
 			break;
 		case TRACE_OVERFLOW:
 			printf("**OVERFLOW**: %"PRIu64" bytes missed\n",
-- 
2.20.1



More information about the Skiboot mailing list