From: Josh Triplett <josh@joshtriplett.org>
To: Joe Perches <joe@perches.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Andy Whitcroft <apw@canonical.com>
Subject: Re: checkpatch not warning for some split strings
Date: Mon, 2 Dec 2013 13:33:58 -0800 [thread overview]
Message-ID: <20131202213358.GA15802@jtriplet-mobl1> (raw)
In-Reply-To: <1386019438.2680.32.camel@joe-AO722>
On Mon, Dec 02, 2013 at 01:23:58PM -0800, Joe Perches wrote:
> Hey Josh.
>
> Back when you added commit ca56dc098ca
> ("checkpatch: check for quoted strings broken across lines")
>
> You added this test case:
>
> Test case:
>
> void context(void)
> {
> struct { unsigned magic; const char *strdata; } foo[] = {
> { 42, "these strings"
> "do not produce warnings" },
> { 256, "though perhaps"
> "they should" },
> };
>
> which avoids emitting a warning on split strings across
> multiple lines without a function-call like '(' use on
> the line above.
>
> Perhaps the "\(" test should be removed as checkpatch
> doesn't emit a warning for some uses like:
>
> diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c
> []
> @@ -1868,7 +1865,8 @@ static void rs_rate_scale_perform(struct iwl_mvm *mvm,
> /* Else poor success; go back to mode in "active" table */
> } else {
> IWL_DEBUG_RATE(mvm,
> - "LQ: GOING BACK TO THE OLD TABLE suc=%d cur-tpt=%d old-tpt=%d\n",
> + "GOING BACK TO THE OLD TABLE: SR %d "
> + "cur-tpt %d old-tpt %d\n",
> window->success_ratio,
> window->average_tpt,
> lq_sta->last_tpt);
That one should definitely emit a warning. However, removing the \(
test entirely will introduce warnings on many other strings embedded in
data structures; only drop that test if you've diffed the checkpatch
output for the kernel with and without it and you're comfortable with
the *huge* number of additional warnings it'll introduce.
- Josh Triplett
next prev parent reply other threads:[~2013-12-02 21:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 21:23 checkpatch not warning for some split strings Joe Perches
2013-12-02 21:33 ` Josh Triplett [this message]
2013-12-03 5:44 ` [PATCH] checkpatch: More comprehensive split strings warning Joe Perches
2013-12-03 8:56 ` Josh Triplett
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=20131202213358.GA15802@jtriplet-mobl1 \
--to=josh@joshtriplett.org \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.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