linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Cc: Joe Perches <joe@perches.com>, Borislav Petkov <bp@alien8.de>,
	LKML <linux-kernel@vger.kernel.org>, Borislav Petkov <bp@suse.de>,
	Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>,
	Kees Cook <keescook@chromium.org>,
	Tony Luck <tony.luck@intel.com>, Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	"Huang, Ying" <ying.huang@intel.com>
Subject: Re: [PATCH] APEI/ERST: Fix error message formatting
Date: Thu, 01 Aug 2013 15:40:34 +0530	[thread overview]
Message-ID: <51FA341A.7060307@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAErSpo6hcjL_A9Vr1R0GqobUysdskd8B1S_9r7-zBSUvELFPXw@mail.gmail.com>

On 07/31/2013 11:30 PM, Bjorn Helgaas wrote:
> On Wed, Jul 31, 2013 at 3:46 AM, Naveen N. Rao
> <naveen.n.rao@linux.vnet.ibm.com> wrote:
>
>> My key question was about why we are using a field width of 10 implying a
>> 32-bit value, rather than a field width of 18 as suggested by the data type?
>> This shouldn't truncate the value, but if we are specifying the field width
>> for alignment, seems to me it is better to match the data type.
>
> %pR uses a field width of 10 (two for "0x", eight for the value)
> simply because the majority of resource values fit in 32 bits.  Larger
> values extend the width, so it's not a question of truncating any
> data.  But it's no fun to read memory addresses when most of them have
> eight extra leading zeros (the high 32-bits of a 64-bit value).  I
> think the same applies here; most ACPI table addresses still fit in 32
> bits.
>
> We *do* use a field width of 18 for the e820 table, even though many
> of those regions fit in 32 bits.  But that's sort of an exception
> because it's a table where addresses above 4GB are pretty common.

Makes sense, thanks for the explanation.

>
> But at the end of the day, I guess I'm just stating my personal
> preferences and yours might be different.

Right - I'd probably prefer just %#llx. But yeah, the currently used 
field width of 10 looks fine too.


Thanks,
Naveen

  reply	other threads:[~2013-08-01 10:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 21:01 [PATCH] APEI/ERST: Fix error message formatting Borislav Petkov
2013-07-22 21:24 ` Kees Cook
2013-07-24 17:13 ` Naveen N. Rao
2013-07-24 17:23   ` Joe Perches
2013-07-25 11:23     ` Naveen N. Rao
2013-07-25 17:32       ` Bjorn Helgaas
2013-07-29 13:58         ` Borislav Petkov
2013-07-29 14:28           ` Bjorn Helgaas
2013-07-29 14:40             ` Borislav Petkov
2013-07-29 14:50               ` Bjorn Helgaas
2013-07-29 15:22                 ` Borislav Petkov
2013-07-29 15:32                   ` Joe Perches
2013-07-29 16:12                   ` Bjorn Helgaas
2013-07-31  9:23                     ` Borislav Petkov
2013-07-31  9:57                   ` Naveen N. Rao
2013-07-31  9:46         ` Naveen N. Rao
2013-07-31 18:00           ` Bjorn Helgaas
2013-08-01 10:10             ` Naveen N. Rao [this message]
2013-07-24 18:10   ` Borislav Petkov

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=51FA341A.7060307@linux.vnet.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=anton@enomsg.org \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=ccross@android.com \
    --cc=joe@perches.com \
    --cc=keescook@chromium.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=tony.luck@intel.com \
    --cc=ying.huang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).