Hi, Likhitha
Thank you for the patch.
On Mon, Jun 19, 2023 at 8:00 PM <crash-utility-request@redhat.com> wrote:
Date: Fri, 16 Jun 2023 17:25:19 +0530
From: Likhitha Korrapati <likhitha@linux.ibm.com>
To: sourabhjain@linux.ibm.com, crash-utility@redhat.com
Subject: [Crash-utility] [PATCH] crash/ppc64: Remove redundant PTE
        checks.
Message-ID: <20230616115519.79791-1-likhitha@linux.ibm.com>
Content-Type: text/plain; charset="US-ASCII"; x-default=true

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.


Looks good to me. So: Ack.

Thanks.
Lianbo
 
Signed-off-by: Likhitha Korrapati <likhitha@linux.ibm.com>
---
 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) {
--
2.31.1