[PATCH] ARM: l2x0: Check the correct address range
Kanigeri, Hari
h-kanigeri2 at ti.com
Fri Nov 19 06:30:14 EST 2010
> From: Boojin Kim <boojin.kim at samsung.com>
>
> When flush or clean the 1MiB, it doesn't flush or clean all since it doesn't check the correct address. So Check the correct address range.
I saw this before but then I thought that the individual callers of
cache functions have to call with +1 to the end address.
>
> Signed-off-by: Boojin Kim <boojin.kim at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> ---
> diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
> index 170c9bb..50599d9 100644
> --- a/arch/arm/mm/cache-l2x0.c
> +++ b/arch/arm/mm/cache-l2x0.c
> @@ -195,7 +195,7 @@ static void l2x0_clean_range(unsigned long start, unsigned long end)
> void __iomem *base = l2x0_base;
> unsigned long flags;
>
> - if ((end - start) >= l2x0_size) {
> + if ((end - start + 1) >= l2x0_size) {
nitpick: probably will look more obvious if it is coded as if ((end +
1) - start) >= l2x0_size)
> l2x0_clean_all();
> return;
> }
> @@ -225,7 +225,7 @@ static void l2x0_flush_range(unsigned long start, unsigned long end)
> void __iomem *base = l2x0_base;
> unsigned long flags;
>
> - if ((end - start) >= l2x0_size) {
> + if ((end - start + 1) >= l2x0_size) {
same as above.
Thank you,
Best regards,
Hari Kanigeri
More information about the linux-arm-kernel
mailing list