From: Keith Busch <keith.busch@intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Keith Busch <keith.busch@intel.com>,
linux-kernel@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH] Regulator: Suppress compiler warnings
Date: Tue, 1 Sep 2015 18:40:46 +0000 (UTC) [thread overview]
Message-ID: <alpine.LNX.2.00.1509011837470.23840@localhost.lm.intel.com> (raw)
In-Reply-To: <20150901130955.GV5313@sirena.org.uk>
On Tue, 1 Sep 2015, Mark Brown wrote:
> On Tue, Sep 01, 2015 at 09:52:13AM +0900, Krzysztof Kozlowski wrote:
>> 2015-09-01 1:41 GMT+09:00 Keith Busch <keith.busch@intel.com>:
>>> int regulator_is_enabled_regmap(struct regulator_dev *rdev)
>>> {
>>> - unsigned int val;
>>> + unsigned int uninitialized_var(val);
>>> int ret;
>>>
>>> ret = regmap_read(rdev->regmap, rdev->desc->enable_reg, &val);
>
>> This is quite common pattern so such work-around should be added to
>> many other functions leading to code obfuscation. Which compiler do
>> you have in mind?
>
> Right, plus this will shut up valid compiler warnings which is poor
> practice anyway. I'd say this is a bug in the compiler.
Using gcc 4.7.2 with '-Os'. The warning does not happen when that option
is not used, i.e. disable CONFIG_CC_OPTIMIZE_FOR_SIZE.
I will certainly try other gcc versions with the same config and see
what happens.
prev parent reply other threads:[~2015-09-01 18:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 16:41 Keith Busch
2015-09-01 0:52 ` Krzysztof Kozlowski
2015-09-01 13:09 ` Mark Brown
2015-09-01 18:40 ` Keith Busch [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=alpine.LNX.2.00.1509011837470.23840@localhost.lm.intel.com \
--to=keith.busch@intel.com \
--cc=broonie@kernel.org \
--cc=k.kozlowski@samsung.com \
--cc=lgirdwood@gmail.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
all inboxes | Powered by JetHome®