History

tracing: Fix function-graph build warning on 32-bit

Fix kernel/trace/trace_functions_graph.c: In function ‘trace_print_graph_duration’: kernel/trace/trace_functions_graph.c:652: warning: comparison of distinct pointer types lacks a cast when building 36-rc6 on a 32-bit due to the strict type check failing in the min() macro.

Borislav Petkov committed 16 years ago

Commit 14cae9b1 parent 7cd25411 file · +3 −2Browse files

Unified · Split

kernel/trace/trace_functions_graph.c+3−2
@@ -665,8 +665,9 @@ trace_print_graph_duration(unsigned long long duration, struct trace_seq *s) · 664 unmodified lines
665665
666666 /* Print nsecs (we don't want to exceed 7 numbers) */
667667 if (len < 7) {
668− snprintf(nsecs_str, min(sizeof(nsecs_str), 8UL - len), "%03lu",
669− nsecs_rem);
668+ size_t slen = min_t(size_t, sizeof(nsecs_str), 8UL - len);
669+
670+ snprintf(nsecs_str, slen, "%03lu", nsecs_rem);
670671 ret = trace_seq_printf(s, ".%s", nsecs_str);
671672 if (!ret)
672673 return TRACE_TYPE_PARTIAL_LINE;