From: bpringlemeir@nbsps.com (Bill Pringlemeir)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: clk-imx6sl: Suppress duplicate const sparse warning
Date: Thu, 16 Jan 2014 12:28:19 -0500 [thread overview]
Message-ID: <87bnzb6dl8.fsf@nbsps.com> (raw)
In-Reply-To: <87fvon6elf.fsf@nbsps.com> (Bill Pringlemeir's message of "Thu, 16 Jan 2014 12:06:36 -0500")
On 16 Jan 2014, bpringlemeir at nbsps.com wrote:
>> It was added into checkpatch.pl by commit cb710ec (scripts/checkpatch.pl:
>> add warnings for static char that could be static const char). I'm not
>> sure which warning we should ignore, the sparse or the checkpatch one.
> I think both scripts/programs are right. There is a difference.
> static const char const * step_sels[] = { "osc", "pll2_pfd2", }; /* dup */
> static const char * const step_sels[] = { "osc", "pll2_pfd2", }; /* ok */
> static char const * const step_sels[] = { "osc", "pll2_pfd2", }; /* ok */
> I think that 'type const * const' is a const pointer to const data, but
> 'const type const *' is just a const pointer (with duplicate). The
> patches have made the data non-const?
Sorry, that patch is correct. It just removed the duplicate 'const',
but checkpatch is right to recommend the 'const * const' as the strings
could be put in a read-only section.
next prev parent reply other threads:[~2014-01-16 17:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 6:19 [PATCH] ARM: imx: clk-imx6sl: Suppress duplicate const sparse warning Liu Ying
2014-01-15 6:58 ` Shawn Guo
2014-01-15 9:21 ` Joe Perches
2014-01-15 11:24 ` Shawn Guo
2014-01-16 17:06 ` Bill Pringlemeir
2014-01-16 17:28 ` Bill Pringlemeir [this message]
2014-01-17 5:44 ` Shawn Guo
2014-01-15 11:27 ` Shawn Guo
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=87bnzb6dl8.fsf@nbsps.com \
--to=bpringlemeir@nbsps.com \
--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).