Re: [PATCH 08/10] sparc64: Fix range check in kern_addr_valid().

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

 



On Wed, Apr 30, 2014 at 05:55:48PM -0400, David Miller wrote:
> --- a/arch/sparc/include/asm/pgtable_64.h
> +++ b/arch/sparc/include/asm/pgtable_64.h
> @@ -916,7 +916,7 @@ static inline bool kern_addr_valid(unsigned long addr)
>  {
>  	unsigned long paddr = __pa(addr);
>  
> -	if ((paddr >> 41UL) != 0UL)
> +	if ((paddr >> MAX_PHYS_ADDRESS_BITS) != 0UL)
>  		return false;
>  	return test_bit(paddr >> 22, sparc64_valid_addr_bitmap);

BTW, maybe this other magic constant - 22 - could be replaced as well?
Is that ILOG2_4MB?

-- 
     2. That which causes joy or happiness.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux