From: Paul Bolle <pebolle@tiscali.nl>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Valdis.Kletnieks@vt.edu, Jakub Jelinek <jakub@redhat.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] regmap: silence GCC warning
Date: Mon, 08 Oct 2012 22:06:30 +0200 [thread overview]
Message-ID: <1349726790.1397.13.camel@x61.thuisdomein> (raw)
In-Reply-To: <20121008011429.GA19748@opensource.wolfsonmicro.com>
Building regmap.o triggers this GCC warning:
drivers/base/regmap/regmap.c: In function ‘regmap_raw_read’:
drivers/base/regmap/regmap.c:1172:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Long story short: Jakub Jelinek pointed out that there is a type
mismatch between 'num' in regmap_volatile_range() and 'val_count' in
regmap_raw_read(). And indeed, converting 'num' to the type of
'val_count' (ie, size_t) makes this warning go away.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
drivers/base/regmap/regmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index c241ae2..b99d5d3 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -82,7 +82,7 @@ bool regmap_precious(struct regmap *map, unsigned int reg)
}
static bool regmap_volatile_range(struct regmap *map, unsigned int reg,
- unsigned int num)
+ size_t num)
{
unsigned int i;
--
1.7.11.4
next prev parent reply other threads:[~2012-10-08 20:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-30 10:15 [PATCH] " 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
2012-10-08 1:14 ` Mark Brown
2012-10-08 20:06 ` Paul Bolle [this message]
2012-10-12 6:26 ` [PATCH v2] " 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=1349726790.1397.13.camel@x61.thuisdomein \
--to=pebolle@tiscali.nl \
--cc=Valdis.Kletnieks@vt.edu \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gregkh@linuxfoundation.org \
--cc=jakub@redhat.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®