mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Helge Deller <deller@gmx.de>
Cc: Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org
Subject: Re: [PATCH] printk-formats.txt: Add examples for %pS and %pF
Date: Tue, 15 Aug 2017 17:35:52 -0400	[thread overview]
Message-ID: <20170815173552.01d7fb1c@gandalf.local.home> (raw)
In-Reply-To: <b94857ad-8c10-618c-1a04-5859cc5ac04b@gmx.de>

On Tue, 15 Aug 2017 21:47:27 +0200
Helge Deller <deller@gmx.de> wrote:

> > Very interesting!
> > 
> > This code:
> > void smp_cpus_done() {
> > printk("Called from %pF.\n", smp_cpus_done);
> > printk("Called from %pf.\n", smp_cpus_done);
> > printk("Called in %pS.\n", __func__);
> > printk("Called in %ps.\n", __func__);
> > printk("Called in %pF.\n", __func__);
> > printk("Called in %pf.\n", __func__);
> > 
> > gives:
> >  Called from smp_cpus_done+0x0/0x1b8.
> >  Called from smp_cpus_done.
> >  Called in __func__.28197+0x0/0x20.
> >  Called in __func__.28197.
> >  Called in 0x5041524953433332.
> >  Called in 0x5041524953433332.
> > 
> > So, the correct usage is:
> > printk("Called in %pS.\n", __func__);  
> 
> I'm wrong.
> The correct usage would be:
>  printk("Called in %s.\n", __func__);
> 
> __func__ is just a pointer to a string.

OK, I'm still on vacation :-/

Yeah, I was looking for usages of %pF, and came across this:

		pr_warn("%s: NULL omap_sr from %pF\n",
			__func__, (void *)_RET_IP_);

And not noticing the first "%s" :-p

-- Steve

      reply	other threads:[~2017-08-15 21:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 17:35 Helge Deller
2017-08-11  0:15 ` Sergey Senozhatsky
2017-08-11  7:31   ` Helge Deller
2017-08-15 11:36     ` Petr Mladek
2017-08-15 19:58       ` Helge Deller
2017-08-23 14:48         ` Petr Mladek
2017-08-23 14:49           ` Steven Rostedt
2017-08-23 19:36             ` Helge Deller
2017-08-24  9:21               ` Petr Mladek
2017-08-24  0:41           ` Sergey Senozhatsky
2017-08-24  2:11             ` Steven Rostedt
2017-08-16  8:14       ` Sergey Senozhatsky
2017-08-15 12:46 ` Steven Rostedt
2017-08-15 19:41   ` Helge Deller
2017-08-15 19:47     ` Helge Deller
2017-08-15 21:35       ` Steven Rostedt [this message]

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=20170815173552.01d7fb1c@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=deller@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=sergey.senozhatsky@gmail.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

all inboxes | Powered by JetHome®