All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	George Spelvin <linux@horizon.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Andrei Emeltchenko <andrei.emeltchenko@intel.com>,
	mingo@kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Stepan Moskovchenko <stepanm@codeaurora.org>
Subject: Re: [PATCH v2] lib: vsprintf: Add %pa format specifier for phys_addr_t types
Date: Wed, 06 Feb 2013 22:39:39 -0600	[thread overview]
Message-ID: <1360211979.12062.20@driftwood> (raw)
In-Reply-To: <1358900093-16412-1-git-send-email-stepanm@codeaurora.org> (from stepanm@codeaurora.org on Tue Jan 22 18:14:53 2013)

On 01/22/2013 06:14:53 PM, Stepan Moskovchenko wrote:
> Add the %pa format specifier for printing a phys_addr_t
> type and its derivative types (such as resource_size_t),
> since the physical address size on some platforms can vary
> based on build options, regardless of the native integer
> type.
> 
> Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>

Ok, I know I'm late to the party, but doesn't LP64 apply here? Are we  
really capable of building on a target where "long" and "pointer" are  
different sizes? Last I checked the kernel was full of that assumption  
because there was an actual standard and we demanded that the compiler  
building us comply with it, just like MacOS X and the BSDs do:

Standard:
http://www.unix.org/whitepapers/64bit.html

Rationale:
http://www.unix.org/version2/whatsnew/lp64_wp.html

Insane legacy reasons Windows decided to be "special":
http://blogs.msdn.com/oldnewthing/archive/2005/01/31/363790.aspx

Thus "unsigned long" should by definition be big enough. Using unsigned  
long long means you're doing 64 bit math on 32 bit targets for no  
apparent reason.

What did I miss?

Rob

WARNING: multiple messages have this Message-ID (diff)
From: Rob Landley <rob@landley.net>
To: Stepan Moskovchenko <stepanm@codeaurora.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	George Spelvin <linux@horizon.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Andrei Emeltchenko <andrei.emeltchenko@intel.com>,
	mingo@kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Stepan Moskovchenko <stepanm@codeaurora.org>
Subject: Re: [PATCH v2] lib: vsprintf: Add %pa format specifier for phys_addr_t types
Date: Wed, 06 Feb 2013 22:39:39 -0600	[thread overview]
Message-ID: <1360211979.12062.20@driftwood> (raw)
In-Reply-To: <1358900093-16412-1-git-send-email-stepanm@codeaurora.org> (from stepanm@codeaurora.org on Tue Jan 22 18:14:53 2013)

On 01/22/2013 06:14:53 PM, Stepan Moskovchenko wrote:
> Add the %pa format specifier for printing a phys_addr_t
> type and its derivative types (such as resource_size_t),
> since the physical address size on some platforms can vary
> based on build options, regardless of the native integer
> type.
> 
> Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>

Ok, I know I'm late to the party, but doesn't LP64 apply here? Are we  
really capable of building on a target where "long" and "pointer" are  
different sizes? Last I checked the kernel was full of that assumption  
because there was an actual standard and we demanded that the compiler  
building us comply with it, just like MacOS X and the BSDs do:

Standard:
http://www.unix.org/whitepapers/64bit.html

Rationale:
http://www.unix.org/version2/whatsnew/lp64_wp.html

Insane legacy reasons Windows decided to be "special":
http://blogs.msdn.com/oldnewthing/archive/2005/01/31/363790.aspx

Thus "unsigned long" should by definition be big enough. Using unsigned  
long long means you're doing 64 bit math on 32 bit targets for no  
apparent reason.

What did I miss?

Rob

  parent reply	other threads:[~2013-02-07  4:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22  5:47 [PATCH] lib: vsprintf: Add %pa format specifier for phys_addr_t types Stepan Moskovchenko
2013-01-22  7:29 ` Andy Shevchenko
2013-01-22  7:52   ` Joe Perches
2013-01-22 21:07     ` Stepan Moskovchenko
2013-01-22 22:26 ` Geert Uytterhoeven
2013-01-23  4:14   ` Joe Perches
2013-01-24  0:37     ` Stepan Moskovchenko
2013-01-23  0:14 ` [PATCH v2] " Stepan Moskovchenko
2013-01-24 23:07   ` Andrew Morton
2013-02-07  4:39   ` Rob Landley [this message]
2013-02-07  4:39     ` Rob Landley
2013-02-07  6:39     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360211979.12062.20@driftwood \
    --to=rob@landley.net \
    --cc=akpm@linux-foundation.org \
    --cc=andrei.emeltchenko@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=mingo@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=stepanm@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.