From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] MTD: m25p80: add debugging trace in sst_write()
Date: Wed, 15 Dec 2010 16:12:13 +0000 [thread overview]
Message-ID: <20101215161213.GC9937@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4D08C1C8.3090100@ru.mvista.com>
On Wed, Dec 15, 2010 at 04:25:28PM +0300, Sergei Shtylyov wrote:
>> + DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
>> + dev_name(&flash->spi->dev), __func__, "to",
>
> What's the point of printing "to" as variable? :-)
One valid reason to do this is if you have several formatting strings
all the same. GCC can merge identical strings together.
So, if you have:
"%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "to"
"%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "from"
"%s: %s %s 0x%08x, len %zd", dev_name(), __func__, "foo"
Then you end up with one long string and three short strings instead of
"%s: %s to 0x%08x, len %zd", dev_name(), __func__
"%s: %s from 0x%08x, len %zd", dev_name(), __func__
"%s: %s foo 0x%08x, len %zd", dev_name(), __func__
which'd be three long strings.
next prev parent reply other threads:[~2010-12-15 16:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 11:59 [PATCH] MTD: m25p80: add debugging trace in sst_write() Nicolas Ferre
2010-12-15 13:25 ` Sergei Shtylyov
2010-12-15 16:12 ` Russell King - ARM Linux [this message]
2011-07-08 16:43 ` Nicolas Ferre
2010-12-19 17:00 ` Artem Bityutskiy
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=20101215161213.GC9937@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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 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).