From: Ezequiel Garcia Date: Tue, 12 Feb 2013 19:22:24 +0000 (-0300) Subject: ARM: omap2: gpmc: Remove redundant chip select out of range check X-Git-Tag: v3.10-rc1~102^2~19^2^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5d8edaf1d06e922a3c3d75c52ef5628ceec32c4;p=profile%2Fivi%2Fkernel-x86-ivi.git ARM: omap2: gpmc: Remove redundant chip select out of range check This check is done before the call to gpmc_cs_reserved() and gpmc_cs_set_reserved() and it's redundant to do it again in each function. This simplifies the code a bit. Signed-off-by: Ezequiel Garcia Reviewed-by: Jon Hunter Signed-off-by: Jon Hunter --- diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 7c122bb..586dba7 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -441,22 +441,14 @@ static int gpmc_cs_mem_enabled(int cs) return l & GPMC_CONFIG7_CSVALID; } -static int gpmc_cs_set_reserved(int cs, int reserved) +static void gpmc_cs_set_reserved(int cs, int reserved) { - if (cs > GPMC_CS_NUM) - return -ENODEV; - gpmc_cs_map &= ~(1 << cs); gpmc_cs_map |= (reserved ? 1 : 0) << cs; - - return 0; } static bool gpmc_cs_reserved(int cs) { - if (cs > GPMC_CS_NUM) - return true; - return gpmc_cs_map & (1 << cs); }