From patchwork Fri Apr 19 21:17:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 2466991 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DF12D3FD1A for ; Fri, 19 Apr 2013 21:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754408Ab3DSVRo (ORCPT ); Fri, 19 Apr 2013 17:17:44 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:4239 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754382Ab3DSVRo (ORCPT ); Fri, 19 Apr 2013 17:17:44 -0400 X-Authority-Analysis: v=2.0 cv=DKcNElxb c=1 sm=0 a=rXTBtCOcEpjy1lPqhTCpEQ==:17 a=mNMOxpOpBa8A:10 a=cJp7HLjXnsIA:10 a=5SG0PmZfjMsA:10 a=IkcTkHD0fZMA:10 a=meVymXHHAAAA:8 a=ZFNF33u4WCIA:10 a=VwQbUJbxAAAA:8 a=pGLkceISAAAA:8 a=1XWaLZrsAAAA:8 a=VnNF1IyMAAAA:8 a=o2WwMXiXxKMk1GZNxUYA:9 a=QEXdDO2ut3YA:10 a=jeBq3FmKZ4MA:10 a=UTB_XpHje0EA:10 a=rXTBtCOcEpjy1lPqhTCpEQ==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 74.67.115.198 Received: from [74.67.115.198] ([74.67.115.198:50552] helo=[192.168.23.10]) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 10/7F-12729-674B1715; Fri, 19 Apr 2013 21:17:43 +0000 Message-ID: <1366406262.9609.123.camel@gandalf.local.home> Subject: Re: "unsigned expression < 0" always false warning From: Steven Rostedt To: Bjorn Helgaas Cc: Frederic Weisbecker , Ingo Molnar , "linux-pci@vger.kernel.org" , Lance Ortiz , Gary Hade Date: Fri, 19 Apr 2013 17:17:42 -0400 In-Reply-To: References: X-Mailer: Evolution 3.4.4-2 Mime-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Does this fix your issue? -- Steve From d2802d0739dcc61af5e5ea00773ce7ddead4e9c2 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (Red Hat)" Date: Fri, 19 Apr 2013 17:10:27 -0400 Subject: [PATCH] tracing: Compare to 1 instead of zero for is_signed_type() The formats of the trace events show if the type of a event field is signed or not via a macro called is_signed_type(). This does a trick with the type and compares a -1 to zero after typecasting to the tested type. If it returns true, it's signed, otherwise its not. But this unfortunately triggers a warning by gcc: warning: comparison of unsigned expression < 0 is always false As we know it is always false (that's why we do it), this is a false warning. Luckily for us, the comparison works with a 1 as well, without giving the warning. Convert the check to compare (type)-1 < (type)0 to (type)-1 < (type)1 to determine if the type is signed or not. Link: http://lkml.kernel.org/r/CAErSpo4YXcY9fuOKWYGDkddJwk68kmZTohsmVB6QvrhjboOh1Q@mail.gmail.com Reported-by: Bjorn Helgaas Reported-by: Gary Hade Signed-off-by: Steven Rostedt --- include/linux/ftrace_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 4e28b01..34e00fb 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h @@ -333,7 +333,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type, extern int trace_add_event_call(struct ftrace_event_call *call); extern void trace_remove_event_call(struct ftrace_event_call *call); -#define is_signed_type(type) (((type)(-1)) < (type)0) +#define is_signed_type(type) (((type)(-1)) < (type)1) int trace_set_clr_event(const char *system, const char *event, int set);