Re: [PATCH] gpmc: Remove compilation warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 29, 2008 at 06:40:43PM +0530, ext Pakaravoor, Jagadeesh wrote:
> From: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@xxxxxx>
> 
> Return type of gpmc_init() function is void. Also, the error values
> returned by the function is not used by the caller. Hence it should
> not be returning any value.
> 
> Signed-off-by: Anand Gadiyar <gadiyar@xxxxxx>
> Signed-off-by: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@xxxxxx>
> --
> Index: linux-omap-git/arch/arm/mach-omap2/gpmc.c
> ===================================================================
> --- linux-omap-git.orig/arch/arm/mach-omap2/gpmc.c	2008-09-25 17:30:24.000000000 +0530
> +++ linux-omap-git/arch/arm/mach-omap2/gpmc.c	2008-09-29 18:26:40.845433948 +0530
> @@ -427,16 +427,13 @@ void __init gpmc_init(void)
>  	}
>  
>  	gpmc_l3_clk = clk_get(NULL, ck);
> -	if (IS_ERR(gpmc_l3_clk)) {
> +	if (IS_ERR(gpmc_l3_clk))
>  		printk(KERN_ERR "Could not get GPMC clock %s\n", ck);
> -		return -ENODEV;
> -	}

Surely you'd be better off making this one 'return;', instead of
blithely continuing.

>  	gpmc_base = ioremap(l, SZ_4K);
>  	if (!gpmc_base) {
>  		clk_put(gpmc_l3_clk);
>  		printk(KERN_ERR "Could not get GPMC register memory\n");
> -		return -ENOMEM;
>  	}

Ditto.

>  	BUG_ON(IS_ERR(gpmc_l3_clk));

You have to decide if you're going to printk and return, or assume this
can never happen and call BUG_ON _instead_.

Cheers,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux