From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266194AbUHFXGX (ORCPT ); Fri, 6 Aug 2004 19:06:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267910AbUHFXGX (ORCPT ); Fri, 6 Aug 2004 19:06:23 -0400 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:11970 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S266194AbUHFXGW (ORCPT ); Fri, 6 Aug 2004 19:06:22 -0400 Date: Sat, 7 Aug 2004 00:03:05 +0100 From: viro@parcelfarce.linux.theplanet.co.uk To: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Subject: Re: PATCH: fix some 32bit isms Message-ID: <20040806230305.GW12308@parcelfarce.linux.theplanet.co.uk> References: <20040728135941.GA17409@devserv.devel.redhat.com> <20040728092334.74e0cfcd.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 06, 2004 at 10:53:50PM +0000, H. Peter Anvin wrote: > Followup to: <20040728092334.74e0cfcd.akpm@osdl.org> > By author: Andrew Morton > In newsgroup: linux.dev.kernel > > > > Alan Cox wrote: > > > > > > printk(MYIOC_s_ERR_FMT > > > "Invalid IOC facts reply, msgLength=%d offsetof=%d!\n", > > > - ioc->name, facts->MsgLength, (offsetof(IOCFactsReply_t, > > > + ioc->name, facts->MsgLength, (int)(offsetof(IOCFactsReply_t, > > > > printk expects %zd for a size_t > > > > It should be %zu, since size_t is unsigned. > > %zd is appropriate for ssize_t. It's signed (and not a ssize_t, while we are at it). If you want to be pedantic, use %td since we are dealing with ptrdiff_t here. BTW, we ought to add 't' modifier in vsnpritf()...