[PATCH 3/9] ARM: at91 smc: Fix possible uninitialized variable

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Apr 26 12:59:28 EDT 2013


On 20:41 Fri 26 Apr     , Alexander Shiyan wrote:
> 
> Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
> ---
>  arch/arm/mach-at91/sam9_smc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
> index b48275e..a137da4 100644
> --- a/arch/arm/mach-at91/sam9_smc.c
> +++ b/arch/arm/mach-at91/sam9_smc.c
> @@ -120,12 +120,12 @@ void sam9_smc_read(int id, int cs, struct sam9_smc_config *config)
>  
>  static int at91sam9_smc_probe(struct device_d *dev)
>  {
you fix nothing here
> -	int id;
> +	int id = dev->id;
>  
> -	if (dev->id < 0) {
> +	if (id < 0) {
>  		id = 0;
> -	} else if (dev->id > 1) {
> -		dev_warn(dev, ": id > 2\n");
> +	} else if (id > 1) {
> +		dev_warn(dev, "id > 1\n");
>  		return -EIO;
>  	}
>  
> -- 
> 1.8.1.5
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox



More information about the barebox mailing list