From patchwork Thu Mar 22 07:35:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 7399 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E69BF23DEA for ; Thu, 22 Mar 2012 07:35:16 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 9F64CA183BF for ; Thu, 22 Mar 2012 07:35:16 +0000 (UTC) Received: by iage36 with SMTP id e36so3641305iag.11 for ; Thu, 22 Mar 2012 00:35:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=f1Z5jbrcImT7Qe8tB98hhzAMidVQfFztGdlLmG2dJnQ=; b=Qe7OtfXkpze7FLyVQeaI6a5OYK0MkpJatIceuhtHn5cFv5P2N4ocV4vutBRc72oq9F A+IOoVjkLA5aGMLY6aSQ7i2HcAlub1Txs2EmI7EbnE4sLPrZKHTxnWKjBCWHBsCW5thi wrwup/TvKjLA5jlGl6u8p9Rk09flZbkBuVol5AQVMcUDLzWUHsG/KQNvKHaWELmFs52i Fq31uWPs0FsayOlwNg7g3rbrN/7k9cN7n+3/OHl5+gqmYn4skL8QEFIcH2SVesTIDrOU DpIJMvV1QZ9J776XPVoTT0eodgH83KGSl8xoEfxlMlqaDCWc2+H6OROxwDqLdUCUzsoU wWIQ== Received: by 10.42.72.130 with SMTP id o2mr4620352icj.8.1332401715909; Thu, 22 Mar 2012 00:35:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.203.79 with SMTP id fh15csp41311ibb; Thu, 22 Mar 2012 00:35:14 -0700 (PDT) Received: by 10.112.49.228 with SMTP id x4mr2446697lbn.90.1332401714030; Thu, 22 Mar 2012 00:35:14 -0700 (PDT) Received: from mail.df.lth.se (mail.df.lth.se. [194.47.250.12]) by mx.google.com with ESMTPS id b9si1070946lba.39.2012.03.22.00.35.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Mar 2012 00:35:13 -0700 (PDT) Received-SPF: neutral (google.com: 194.47.250.12 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=194.47.250.12; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.47.250.12 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) smtp.mail=linus.walleij@linaro.org Received: from fecusia (c83-249-216-134.bredband.comhem.se [83.249.216.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPSA id 8105A65D71; Thu, 22 Mar 2012 08:35:11 +0100 (CET) Received: by fecusia (sSMTP sendmail emulation); Thu, 22 Mar 2012 08:35:11 +0100 From: "Linus Walleij" To: Chris Ball , linux-mmc@vger.kernel.org Cc: Linus Walleij Subject: [PATCH] mmc: fix card block compile warnings Date: Thu, 22 Mar 2012 08:35:09 +0100 Message-Id: <1332401709-25513-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.7.6 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQna3w/Dd/EvdZV8rPm+FrUqJ2ZMvsBfFkomMyI5vTwDX5Q2XHILZf9wqpeYufBfhZB+ylxN 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 --- 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))) {