On 2023/06/16 20:55, Likhitha Korrapati wrote:
 Patch removes redundant checks for PTE (Page Table Entry) because
those
 conditions are already covered.
 
          if (!(pte & _PAGE_PRESENT)) {
                  ...
                  return FALSE;
          }
 
          if (!pte)
                  return FALSE;
 
 The second pte check is redundant because it holds true only when pte is
 0. if pte is 0 then (!(pte & _PAGE_PRESENT)) is true and it will return
 false. so there is no need for one more pte check.
 
 Signed-off-by: Likhitha Korrapati <likhitha(a)linux.ibm.com>
 
thanks for the cleanup.
Acked-by: Kazuhito Hagio <k-hagio-ab(a)nec.com>
Thanks,
Kazu
> ---
>   ppc64.c | 6 ------
>   1 file changed, 6 deletions(-)
> 
> diff --git a/ppc64.c b/ppc64.c
> index b95a621..fc34006 100644
> --- a/ppc64.c
> +++ b/ppc64.c
> @@ -968,9 +968,6 @@ ppc64_vtop(ulong vaddr, ulong *pgd, physaddr_t *paddr, int
verbose)
>   		return FALSE;
>   	}
>   
> -	if (!pte)
> -		return FALSE;
> -
>   	*paddr = PAGEBASE(PTOB(pte >> PTE_RPN_SHIFT_DEFAULT)) + PAGEOFFSET(vaddr);
>   
>   	if (verbose) {
> @@ -1077,9 +1074,6 @@ ppc64_vtop_level4(ulong vaddr, ulong *level4, physaddr_t
*paddr, int verbose)
>   		return FALSE;
>   	}
>   
> -	if (!pte)
> -		return FALSE;
> -
>   out:
>   	if (hugepage_type) {
>   		if (hugepage_type == 2) {