From: Paul Bolle <pebolle@tiscali.nl>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Valdis.Kletnieks@vt.edu,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regmap: silence GCC warning
Date: Sat, 06 Oct 2012 11:57:36 +0200 [thread overview]
Message-ID: <1349517456.1491.33.camel@x61.thuisdomein> (raw)
In-Reply-To: <20121006085306.GB8590@opensource.wolfsonmicro.com>
On Sat, 2012-10-06 at 09:53 +0100, Mark Brown wrote:
> On Fri, Oct 05, 2012 at 06:20:44PM -0400, Valdis.Kletnieks@vt.edu wrote:
> > On Wed, 03 Oct 2012 09:23:36 +0200, Paul Bolle said:
> > > That is another way to silence GCC here.
>
> > That's probably a preferable approach - that way, if a bogus val_count gets
> > passed in, the caller will be informed of the fact. Which is a lot better than
> > just papering over the warning.
>
> As I hinted earlier if someone were to send me a patch...
0) I was hoping to do that. But in the mean time I also filed a bug
report for GCC (at Fedora's bugzilla) [0].
1) In that report (after actually closing it) Jakub Jelinek pointed at
the type mismatch between regmap_volatile_range()'s 'num' (unsigned int)
and its callers (both use size_t, both through 'val_count'). And,
indeed, changing 'num' to size_t also makes this warning go away.
This might explain why you didn't see a warning on 32 bit arm (if that
is what you running while looking at my patch).
2) I hope to send in a second path shortly, changing 'num' to size_t. My
main doubt is whether its problematic that the loop index in
regmap_volatile_range() uses unsigned int too. If 'num' would exceed
UINT_MAX, that loop would never finish, wouldn't it? But is that
actually possible? Are there machines with that many registers?
Paul Bolle
0) https://bugzilla.redhat.com/show_bug.cgi?id=862620
next prev parent reply other threads:[~2012-10-06 9:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-30 10:15 Paul Bolle
2012-10-01 10:03 ` Mark Brown
2012-10-01 10:16 ` Paul Bolle
2012-10-01 10:19 ` Mark Brown
2012-10-01 10:32 ` Paul Bolle
2012-10-01 11:39 ` Mark Brown
2012-10-01 19:08 ` Paul Bolle
2012-10-01 19:11 ` Mark Brown
2012-10-03 0:11 ` Valdis.Kletnieks
2012-10-03 7:23 ` Paul Bolle
2012-10-03 11:06 ` Mark Brown
2012-10-05 22:20 ` Valdis.Kletnieks
2012-10-06 8:53 ` Mark Brown
2012-10-06 9:57 ` Paul Bolle [this message]
2012-10-08 1:14 ` Mark Brown
2012-10-08 20:06 ` [PATCH v2] " Paul Bolle
2012-10-12 6:26 ` Mark Brown
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=1349517456.1491.33.camel@x61.thuisdomein \
--to=pebolle@tiscali.nl \
--cc=Valdis.Kletnieks@vt.edu \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gregkh@linuxfoundation.org \
--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®