From: Arnd Bergmann <arnd@arndb.de>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Sangbeom Kim <sbkim73@samsung.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
jacob.e.keller@intel.com
Subject: Re: [PATCH v2] regulator: s2mps11: Simplify expression used in BUILD_BUG_ON
Date: Thu, 18 Feb 2016 10:06:28 +0100 [thread overview]
Message-ID: <2870104.0q2mccK2EB@wuerfel> (raw)
In-Reply-To: <1455755707-16844-1-git-send-email-k.kozlowski@samsung.com>
On Thursday 18 February 2016 09:35:07 Krzysztof Kozlowski wrote:
> Following BUILD_BUG_ON using a variable fails for some of the compilers
> and optimization levels (reported for gcc 4.9):
> var = ARRAY_SIZE(s2mps15_regulators);
> BUILD_BUG_ON(S2MPS_REGULATOR_MAX < var);
> Fix this by using ARRAY_SIZE directly.
>
> Additionally add missing BUILD_BUG_ON check for S2MPS15 device (the
> check ensures that internal arrays are big enough to hold data for all
> of regulators on all devices).
>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
I've verified that this is the exact patch I have successfully tested
on locally and in Olof's autobuilder which reported the problem.
> case S2MPS15X:
> s2mps11->rdev_num = ARRAY_SIZE(s2mps15_regulators);
> regulators = s2mps15_regulators;
> + BUILD_BUG_ON(S2MPS_REGULATOR_MAX < ARRAY_SIZE(s2mps15_regulators));
> break;
>
My version did not add this line, but it seems correct.
Tested-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
prev parent reply other threads:[~2016-02-18 9:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 0:35 [PATCH v2] regulator: s2mps11: Simplify expression used in BUILD_BUG_ON Krzysztof Kozlowski
2016-02-18 1:37 ` Andi Shyti
2016-02-18 1:38 ` Krzysztof Kozlowski
2016-02-18 1:46 ` Andi Shyti
2016-02-18 1:48 ` Krzysztof Kozlowski
2016-02-18 9:05 ` Arnd Bergmann
2016-02-18 9:06 ` Arnd Bergmann [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=2870104.0q2mccK2EB@wuerfel \
--to=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=k.kozlowski@samsung.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=sbkim73@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox