linux-mips
[Top] [All Lists]

Re: [PATCH] fix some compiler warnings (field width, unused variable)

To: eckhardt@satorlaser.com
Subject: Re: [PATCH] fix some compiler warnings (field width, unused variable)
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Wed, 07 Jun 2006 23:58:45 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <200606071103.34646.eckhardt@satorlaser.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.62.0605311840170.18323@chinchilla.sonytel.be> <20060602.015404.93020143.anemo@mba.ocn.ne.jp> <200606071103.34646.eckhardt@satorlaser.com>
Sender: linux-mips-bounce@linux-mips.org
On Wed, 7 Jun 2006 11:03:34 +0200, Ulrich Eckhardt <eckhardt@satorlaser.com> 
wrote:
> I'm not so sure if this is a good idea because some systems have 36
> bit physical addresses while they only have 32 bit void pointers, so
> long long is probably really the better solution.

In general, it would be better to use "long long" for 32bit physical
address.  For this particular code, both values are "unsigned long" so
casting to "void *" for printing should be safe anyway.

> I'm wondering if it would be worth having a special flag in printk
> to indicate a physical address ("%lp" perhaps?) so that you don't
> get the unimportant leading zeroes for the bits 36 to 63 for above
> mentioned platforms.

It might raise some new gcc/sparse warnings about format strings :-)

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>