public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: fix card block compile warnings
@ 2012-03-22  7:35 Linus Walleij
  2012-03-22 10:58 ` Ulf Hansson
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2012-03-22  7:35 UTC (permalink / raw)
  To: Chris Ball, linux-mmc; +Cc: Linus Walleij

I'm pretty tired of seeing these in my kernel compiles:
drivers/mmc/card/block.c: In function ‘mmc_blk_issue_secdiscard_rq’:
drivers/mmc/card/block.c:911:18: warning: ‘arg’ may be used uninitialized in this function [-Wuninitialized]
drivers/mmc/card/block.c:910:6: warning: ‘nr’ may be used uninitialized in this function [-Wuninitialized]
drivers/mmc/card/block.c:910:6: warning: ‘from’ may be used uninitialized in this function [-Wuninitialized]

This patch marks the variables explicitly uninitialized as
seems to be the intention, I can assure myself they are not
actually uninitialized at use time by just reading the code.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/card/block.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index c6a383d..214ae68 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -874,7 +874,9 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
 {
 	struct mmc_blk_data *md = mq->data;
 	struct mmc_card *card = md->queue.card;
-	unsigned int from, nr, arg;
+	unsigned int uninitialized_var(from);
+	unsigned int uninitialized_var(nr);
+	unsigned int uninitialized_var(arg);
 	int err = 0, type = MMC_BLK_SECDISCARD;
 
 	if (!(mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))) {
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-23  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22  7:35 [PATCH] mmc: fix card block compile warnings Linus Walleij
2012-03-22 10:58 ` Ulf Hansson
2012-03-22 18:02   ` Linus Walleij
2012-03-23  5:46     ` Rabin Vincent
2012-03-23  9:05       ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox