All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: David Daney <ddaney.cavm@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org,
	David Daney <david.daney@cavium.com>
Subject: Re: [PATCH] iqrdomain: Improve formatting in debugfs.
Date: Wed, 11 Apr 2012 08:57:44 -0600	[thread overview]
Message-ID: <CACxGe6sctZ_Qf7x8wUHWq9F191+=LkX7gPZjrEyS=xQ3W1e7ig@mail.gmail.com> (raw)
In-Reply-To: <CACxGe6sDcqu6TcS9ZYYeNffMdUrH0_SVou37H83qzM8mKAGV_A@mail.gmail.com>

On Wed, Apr 11, 2012 at 8:52 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Wed, Apr 11, 2012 at 3:16 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> Grant Likely <grant.likely@secretlab.ca> writes:
>>
>>> @@ -667,7 +667,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
>>>                       seq_printf(m, "%-15s  ", p);
>>>
>>>                       data = irq_desc_get_chip_data(desc);
>>> -                     seq_printf(m, "0x%16p  ", data);
>>> +                     seq_printf(m, data ? "0x%p  " : "  %p  ", data);
>>
>> You should be able to use %#p instead to let it add the prefix.
>
> That mostly works, but it doesn't round up the field size to account
> for the 2 characters in '0x'.  Looks like the %p code needs to be
> tweaked to fix that.

which this change does:

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index abbabec..4c4f2ce 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -946,6 +946,8 @@ char *pointer(const char *fmt, char *buf, char
*end, void *ptr,
        if (spec.field_width == -1) {
                spec.field_width = 2 * sizeof(void *);
                spec.flags |= ZEROPAD;
+               if (spec.flags & SPECIAL)
+                       spec.field_width += 2;
        }
        spec.base = 16;

  reply	other threads:[~2012-04-11 14:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10  0:06 [PATCH] iqrdomain: Improve formatting in debugfs David Daney
2012-04-11  7:03 ` Grant Likely
2012-04-11  9:16   ` Andreas Schwab
2012-04-11 14:52     ` Grant Likely
2012-04-11 14:57       ` Grant Likely [this message]
2012-04-16 22:01       ` Andreas Schwab
2012-04-16 22:25         ` Grant Likely
2012-04-11 15:33   ` David Daney
2012-04-12 19:20   ` Andreas Schwab
2012-04-12 20:38     ` David Daney
2012-04-12 20:46       ` Grant Likely

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='CACxGe6sctZ_Qf7x8wUHWq9F191+=LkX7gPZjrEyS=xQ3W1e7ig@mail.gmail.com' \
    --to=grant.likely@secretlab.ca \
    --cc=benh@kernel.crashing.org \
    --cc=david.daney@cavium.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwab@linux-m68k.org \
    --cc=tglx@linutronix.de \
    /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.