lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 26 Apr 2019 12:10:59 +0530
From:   "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
To:     Christophe Leroy <christophe.leroy@....fr>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>
Cc:     linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 07/11] powerpc/mm: remove a couple of #ifdef CONFIG_PPC_64K_PAGES in mm/slice.c

Christophe Leroy <christophe.leroy@....fr> writes:

> This patch replaces a couple of #ifdef CONFIG_PPC_64K_PAGES
> by IS_ENABLED(CONFIG_PPC_64K_PAGES) to improve code maintainability.
>

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@...ux.ibm.com>

> Signed-off-by: Christophe Leroy <christophe.leroy@....fr>
> ---
>  arch/powerpc/mm/slice.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
> index 840c4118a185..ace97d953040 100644
> --- a/arch/powerpc/mm/slice.c
> +++ b/arch/powerpc/mm/slice.c
> @@ -606,14 +606,13 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
>  	newaddr = slice_find_area(mm, len, &potential_mask,
>  				  psize, topdown, high_limit);
>  
> -#ifdef CONFIG_PPC_64K_PAGES
> -	if (newaddr == -ENOMEM && psize == MMU_PAGE_64K) {
> +	if (IS_ENABLED(CONFIG_PPC_64K_PAGES) && newaddr == -ENOMEM &&
> +	    psize == MMU_PAGE_64K) {
>  		/* retry the search with 4k-page slices included */
>  		slice_or_mask(&potential_mask, &potential_mask, compat_maskp);
>  		newaddr = slice_find_area(mm, len, &potential_mask,
>  					  psize, topdown, high_limit);
>  	}
> -#endif
>  
>  	if (newaddr == -ENOMEM)
>  		return -ENOMEM;
> @@ -784,9 +783,9 @@ int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
>  	VM_BUG_ON(radix_enabled());
>  
>  	maskp = slice_mask_for_size(&mm->context, psize);
> -#ifdef CONFIG_PPC_64K_PAGES
> +
>  	/* We need to account for 4k slices too */
> -	if (psize == MMU_PAGE_64K) {
> +	if (IS_ENABLED(CONFIG_PPC_64K_PAGES) && psize == MMU_PAGE_64K) {
>  		const struct slice_mask *compat_maskp;
>  		struct slice_mask available;
>  
> @@ -794,7 +793,6 @@ int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
>  		slice_or_mask(&available, maskp, compat_maskp);
>  		return !slice_check_range_fits(mm, &available, addr, len);
>  	}
> -#endif
>  
>  	return !slice_check_range_fits(mm, maskp, addr, len);
>  }
> -- 
> 2.13.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ