public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nikita Kiryanov <nikita@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] spl: mmc: Fix compiler warning with CONFIG_DM_MMC
Date: Tue, 1 Dec 2015 14:02:50 +0200	[thread overview]
Message-ID: <20151201120250.GA29932@skynet> (raw)
In-Reply-To: <1448903949-2092-2-git-send-email-sjg@chromium.org>

Hi Simon,

On Mon, Nov 30, 2015 at 10:19:06AM -0700, Simon Glass wrote:
> Since commit 4188ba3 we get the following warning on rockchip boards:
> 
> common/spl/spl_mmc.c:111:10: error: 'mmc' undeclared (first use in this function)
> 
> Correct this by move the variable init earlier.

This looks suspicious. If the problem is that the variable is
undeclared, the only way to fix it is to declare the variable, which is
not what this patch does. I would expect this error to persist with
the patch applied. Also, mmc is clearly declared in the function
parameter list. It sounds to me like the source of the compile error is
somewhere earlier in the code.

> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  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;
>  }
> -- 
> 2.6.0.rc2.230.g3dd15c0
> 

  reply	other threads:[~2015-12-01 12:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 17:19 [U-Boot] [PATCH 0/3] spl: mmc: Fix warning and unify spl_mmc_find_device() Simon Glass
2015-11-30 17:19 ` [U-Boot] [PATCH 1/3] spl: mmc: Fix compiler warning with CONFIG_DM_MMC Simon Glass
2015-12-01 12:02   ` Nikita Kiryanov [this message]
2015-12-01 19:57     ` Tom Rini
2015-12-01 20:01     ` Simon Glass
2015-12-01 20:19       ` Tom Rini
2015-12-02  0:33         ` Simon Glass
2015-12-02  0:46           ` Tom Rini
2015-11-30 17:19 ` [U-Boot] [PATCH 2/3] spl: mmc: Rename 'mmc' variable to 'mmcp' Simon Glass
2015-12-01 12:10   ` Nikita Kiryanov
2015-11-30 17:19 ` [U-Boot] [PATCH 3/3] spl: mmc: Unify non/driver model spl_mmc_find_device() Simon Glass
2015-12-02 10:22 ` [U-Boot] [PATCH 0/3] spl: mmc: Fix warning and unify spl_mmc_find_device() Michal Simek

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=20151201120250.GA29932@skynet \
    --to=nikita@compulab.co.il \
    --cc=u-boot@lists.denx.de \
    /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