crash-utility / crash

Linux kernel crash utility
https://crash-utility.github.io
788 stars 266 forks source link

crash/ppc64: Remove redundant PTE checks. #145

Closed Likhitha26 closed 1 year ago

Likhitha26 commented 1 year ago

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.

k-hagio commented 1 year ago

Closing with 8b24b2025fb4ae9bd6102bb054bd23987c35387e.