From: Ian Arkver <ian.arkver.dev@gmail.com>
To: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"hverkuil@xs4all.nl" <hverkuil@xs4all.nl>,
"mattw@codeaurora.org" <mattw@codeaurora.org>,
"mitchelh@codeaurora.org" <mitchelh@codeaurora.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"yamada.masahiro@socionext.com" <yamada.masahiro@socionext.com>
Cc: "linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
Chris Paterson <Chris.Paterson2@renesas.com>
Subject: Re: [PATCH v2 0/2] Avoid namespace collision within macros & tidyup
Date: Wed, 14 Jun 2017 08:23:23 +0100 [thread overview]
Message-ID: <86f9bbd7-bf28-dab0-a455-0dc047dfe8c1@gmail.com> (raw)
In-Reply-To: <KL1PR0601MB20388B133E5E841FF5BF2D4BC3C30@KL1PR0601MB2038.apcprd06.prod.outlook.com>
On 14/06/17 08:18, Ramesh Shanmugasundaram wrote:
>> Subject: Re: [PATCH v2 0/2] Avoid namespace collision within macros &
>> tidyup
>>
>> On 13/06/17 14:33, Ramesh Shanmugasundaram wrote:
>>> Hi All,
>>>
>>> The readx_poll_timeout & similar macros defines local variable that
>>> can cause name space collision with the caller. Fixed this issue by
>>> prefixing them with underscores.
>>
>> The compound statement has a local variable scope, so these won't collide
>> with the caller I believe.
>
> But xxx_poll_timeout is a macro??
>
> Usage regmap_read_poll_timeout(..., timeout) with variable name "timeout" in the caller results in
>
> include/linux/regmap.h:123:20: warning: 'timeout' is used uninitialized in this function [-Wuninitialized]
> ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
>
Oh right, collide with a passed in variable, yes. Sorry.
>>
>>> Also tidied couple of instances where the macro arguments are used in
>>> expressions without paranthesis.
>>>
>>> This patchset is based on top of today's linux-next repo.
>>> commit bc4c75f41a1c ("Add linux-next specific files for 20170613")
>>>
>>> Change history:
>>>
>>> v2:
>>> - iopoll.h:
>>> - Enclosed timeout_us & sleep_us arguments with paranthesis
>>> - regmap.h:
>>> - Enclosed timeout_us & sleep_us arguments with paranthesis
>>> - Renamed pollret to __ret
>>>
>>> Note: timeout_us cause spare check warning as identified here [1].
>>>
>>> [1]
>>> https://www.mail-archive.com/linux-renesas-soc@vger.kernel.org/msg1513
>>> 8.html
>>>
>>> Thanks,
>>> Ramesh
>>>
>>> Ramesh Shanmugasundaram (2):
>>> iopoll: Avoid namespace collision within macros & tidyup
>>> regmap: Avoid namespace collision within macro & tidyup
>>>
>>> include/linux/iopoll.h | 12 +++++++-----
>>> include/linux/regmap.h | 17 +++++++++--------
>>> 2 files changed, 16 insertions(+), 13 deletions(-)
>>>
prev parent reply other threads:[~2017-06-14 7:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-13 13:33 [PATCH v2 0/2] Avoid namespace collision within macros & tidyup Ramesh Shanmugasundaram
2017-06-13 13:33 ` [PATCH v2 1/2] iopoll: " Ramesh Shanmugasundaram
2017-06-13 14:15 ` Geert Uytterhoeven
2017-07-03 9:55 ` Ramesh Shanmugasundaram
2017-06-13 13:33 ` [PATCH v2 2/2] regmap: Avoid namespace collision within macro " Ramesh Shanmugasundaram
2017-07-10 18:42 ` Applied "regmap: Avoid namespace collision within macro & tidy up" to the regmap tree Mark Brown
2017-06-14 6:48 ` [PATCH v2 0/2] Avoid namespace collision within macros & tidyup Ian Arkver
2017-06-14 7:18 ` Ramesh Shanmugasundaram
2017-06-14 7:23 ` Ian Arkver [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=86f9bbd7-bf28-dab0-a455-0dc047dfe8c1@gmail.com \
--to=ian.arkver.dev@gmail.com \
--cc=Chris.Paterson2@renesas.com \
--cc=akpm@linux-foundation.org \
--cc=broonie@kernel.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mattw@codeaurora.org \
--cc=mitchelh@codeaurora.org \
--cc=ramesh.shanmugasundaram@bp.renesas.com \
--cc=yamada.masahiro@socionext.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 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.