[PATCH] trace/function-graph: Fix build warning on 32-bit

From: Borislav Petkov
Date: Wed Sep 29 2010 - 03:39:02 EST


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.

Signed-off-by: Borislav Petkov <bp@xxxxxxxxx>
---
kernel/trace/trace_functions_graph.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 6f23369..4eab958 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -649,8 +649,10 @@ trace_print_graph_duration(unsigned long long duration, struct trace_seq *s)

/* Print nsecs (we don't want to exceed 7 numbers) */
if (len < 7) {
- snprintf(nsecs_str, min(sizeof(nsecs_str), 8UL - len), "%03lu",
- nsecs_rem);
+ unsigned long slen = min_t(unsigned long, sizeof(nsecs_str),
+ 8UL - len);
+
+ snprintf(nsecs_str, slen, "%03lu", nsecs_rem);
ret = trace_seq_printf(s, ".%s", nsecs_str);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
--
1.7.2.3


--
Regards/Gruss,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/