From patchwork Wed Dec 2 00:35:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 551097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 30070140273 for ; Wed, 2 Dec 2015 11:36:27 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=F5sVN13B; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2087B4B9EF; Wed, 2 Dec 2015 01:36:25 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id quY_xTzX7ETG; Wed, 2 Dec 2015 01:36:24 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 172D24BA05; Wed, 2 Dec 2015 01:36:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1CC194B9EC for ; Wed, 2 Dec 2015 01:36:11 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0yYJWR_BEjEx for ; Wed, 2 Dec 2015 01:36:11 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by theia.denx.de (Postfix) with ESMTPS id 9EA274B9E4 for ; Wed, 2 Dec 2015 01:36:06 +0100 (CET) Received: by obbww6 with SMTP id ww6so20259217obb.0 for ; Tue, 01 Dec 2015 16:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Ad+MRHSF2HVZV8IdZykBXqjmLqpXvZHa8z5/C43SSig=; b=F5sVN13BJ3lzuUB6EYgpp1DIZKYISPXY1lhwlG2sh71iseMkmbazf2ASOAWEhsM8ro 1Y+ZrWOQKfvVYwd2J8A1W7Bz+e9C5Rujt3f139Nlq5i5x63v5tKTTE30ciwhkUeg7E1J f8mnOz4b7j1wGgDpsQG3/olN+vAQs5IkYwY/F+Shfe2/vLX1iWpsveE7bfxhXC+/X8ao htWZtz1/TbPECBNO8E8jUf35C/QXZZdHKW/gaoTR+9zMXcDhr2RYAuvxZXmlNxRmDcGk 9ZsGnMRFzue/peSSpTUFMWtjXIxxwBNyZckdzFVS3Rvhujcrlhm8uqXPaafylKcirCFt jtuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=Ad+MRHSF2HVZV8IdZykBXqjmLqpXvZHa8z5/C43SSig=; b=jKo4LdsAg1LUnKvtQoOhMrwzHGxAXTB4rNiJ9xZuZkswP+5GVM0FfPsYbi4HX0IFSl APs2/+Juu/QRU/xyjfamziK3RhrpyMkdlLnQCyNFVfG7djE61sGJvML4fh41iJz/JQp6 6SzShtYR3dpG+tumrAZuTcnUX9hfbmXPh7ONZPRs5LqUAa/X//6AMQbP2Dj8PNLms4RL veGlIofNAj4RhPFc0KaNzoPT1wVXXCZkPboctzrLeHV+0L0cU8lJpyc3qLoDiqYwD8Ne qYDyj3gvda1fNCHZYaT3K/JJ4MR/Y5zwZEURftxYoa0BTgYxSowc5HACmzeo14aLU18E 2o3w== X-Gm-Message-State: ALoCoQnEUEedSt0vFfjYow6/z253d0JCAnmH/+y+TcFAmqVQw0elCMKfJxsz09VM5veA63j9Mw2X X-Received: by 10.182.125.38 with SMTP id mn6mr241369obb.17.1449016565410; Tue, 01 Dec 2015 16:36:05 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id do3sm202367obb.15.2015.12.01.16.36.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 16:36:04 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 601EB2208BD; Tue, 1 Dec 2015 17:36:03 -0700 (MST) From: Simon Glass To: U-Boot Mailing List , Tom Rini Date: Tue, 1 Dec 2015 17:35:57 -0700 Message-Id: <1449016560-3740-2-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1449016560-3740-1-git-send-email-sjg@chromium.org> References: <1449016560-3740-1-git-send-email-sjg@chromium.org> MIME-Version: 1.0 Cc: Pantelis Antoniou Subject: [U-Boot] [PATCH v2 1/3] spl: mmc: Fix compiler warning with CONFIG_DM_MMC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since commit 4188ba3 we get the following warning on rockchip boards: common/spl/spl_mmc.c:31:24: warning: ‘mmc’ may be used uninitialized in this function [-Wmaybe-uninitialized] count = mmc->block_dev.block_read(0, sector, 1, header); ^ common/spl/spl_mmc.c:251:14: note: ‘mmc’ was declared here struct mmc *mmc; Correct this by move the variable init earlier. Signed-off-by: Simon Glass --- Changes in v2: - Fix the warning in the commit message (it was the wrong one) common/spl/spl_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index b3c2c64..9df4786 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -84,6 +84,7 @@ static int spl_mmc_find_device(struct mmc **mmc, u32 boot_device) struct udevice *dev; int err, mmc_dev; + *mmc = NULL; mmc_dev = spl_mmc_get_device_index(boot_device); if (mmc_dev < 0) return mmc_dev; @@ -104,7 +105,6 @@ static int spl_mmc_find_device(struct mmc **mmc, u32 boot_device) return err; } - *mmc = NULL; *mmc = mmc_get_mmc_dev(dev); return *mmc != NULL ? 0 : -ENODEV; }