Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751779AbcCIADt (ORCPT ); Tue, 8 Mar 2016 19:03:49 -0500 Received: from mga14.intel.com ([192.55.52.115]:31905 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbcCIADm (ORCPT ); Tue, 8 Mar 2016 19:03:42 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,558,1449561600"; d="scan'208";a="932610624" Message-ID: <1457481819.28618.1.camel@tzanussi-mobl.amr.corp.intel.com> Subject: Re: [PATCH v16 02/23] tracing: Add 'hist' event trigger command From: Tom Zanussi To: Steven Rostedt Cc: masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, josh@joshtriplett.org, andi@firstfloor.org, mathieu.desnoyers@efficios.com, peterz@infradead.org, linux-kernel@vger.kernel.org Date: Tue, 08 Mar 2016 18:03:39 -0600 In-Reply-To: <20160308172633.66a340bb@gandalf.local.home> References: <72d263b5e1853fe9c314953b65833c3aa75479f2.1457029949.git.tom.zanussi@linux.intel.com> <20160308172633.66a340bb@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1819 Lines: 49 Yep, thanks for fixing these, Steve. Tom On Tue, 2016-03-08 at 17:26 -0500, Steven Rostedt wrote: > FYI, > > -- Steve > > From 65692275fc895f7e2144889cd1335ff037cdb291 Mon Sep 17 00:00:00 2001 > From: "Steven Rostedt (Red Hat)" > Date: Tue, 8 Mar 2016 17:17:15 -0500 > Subject: [PATCH] tracing: Fix unsigned comparison to zero in hist trigger code > > Fengguang Wu's bot found two comparisons of unsigned integers to zero. These > were real bugs, as it would miss error conditions returned to zero. > > trace_events_hist.c:426:6-9: WARNING: Unsigned expression compared with zero: idx < 0 > trace_events_hist.c:568:5-14: WARNING: Unsigned expression compared with zero: n_entries < 0 > > Reported-by: kbuild test robot > Signed-off-by: Steven Rostedt > --- > kernel/trace/trace_events_hist.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c > index 5aa16224036b..92c9f3666fae 100644 > --- a/kernel/trace/trace_events_hist.c > +++ b/kernel/trace/trace_events_hist.c > @@ -734,7 +734,7 @@ static int create_tracing_map_fields(struct hist_trigger_data *hist_data) > struct tracing_map *map = hist_data->map; > struct ftrace_event_field *field; > struct hist_field *hist_field; > - unsigned int i, idx; > + int i, idx; > > for_each_hist_field(i, hist_data) { > hist_field = hist_data->fields[i]; > @@ -1036,7 +1036,7 @@ static int print_entries(struct seq_file *m, > { > struct tracing_map_sort_entry **sort_entries = NULL; > struct tracing_map *map = hist_data->map; > - unsigned int i, n_entries; > + int i, n_entries; > > n_entries = tracing_map_sort_entries(map, hist_data->sort_keys, > hist_data->n_sort_keys,