From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754061AbZCJFXW (ORCPT ); Tue, 10 Mar 2009 01:23:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751995AbZCJFXN (ORCPT ); Tue, 10 Mar 2009 01:23:13 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:44790 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751573AbZCJFXM (ORCPT ); Tue, 10 Mar 2009 01:23:12 -0400 Date: Mon, 9 Mar 2009 22:20:33 -0700 From: Andrew Morton To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Frederic Weisbecker , Theodore Tso , Arnaldo Carvalho de Melo , "H. Peter Anvin" , Mathieu Desnoyers , Lai Jiangshan , "Martin J. Bligh" , "Frank Ch. Eigler" , KOSAKI Motohiro , Larry Woodman , Jason Baron , Tom Zanussi , Masami Hiramatsu , Christoph Hellwig , Jiaying Zhang , Steven Rostedt Subject: Re: [PATCH 1/7] tracing: typecast sizeof and offsetof to unsigned int Message-Id: <20090309222033.d39c7b22.akpm@linux-foundation.org> In-Reply-To: <20090310045810.602528682@goodmis.org> References: <20090310045710.286915983@goodmis.org> <20090310045810.602528682@goodmis.org> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Mar 2009 00:57:11 -0400 Steven Rostedt wrote: > On x86_64 sizeof and offsetof are treated as long, where as on x86_32 > they are int. This patch typecasts them to unsigned int to avoid > one arch giving warnings while the other does not. Actually, both have type size_t. > static int trace_write_header(struct trace_seq *s) > { > @@ -457,11 +458,11 @@ static int trace_write_header(struct trace_seq *s) > > /* struct trace_entry */ > return trace_seq_printf(s, > - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" > - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" > - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" > - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" > - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n" > + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" > + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" > + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" > + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" > + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n" Which may be printed with %z.