Skip to content

Commit c5f1ac5

Browse files
committed
Merge tag 'powerpc-5.0-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fix from Michael Ellerman: "Just one fix, for pgd/pud_present() which were broken on big endian since v4.20, leading to possible data corruption. Thanks to: Aneesh Kumar K.V., Erhard F., Jan Kara" * tag 'powerpc-5.0-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s: Fix possible corruption on big endian due to pgd/pud_present()
2 parents 0513ebc + a580076 commit c5f1ac5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/include/asm/book3s/64/pgtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ static inline int pud_none(pud_t pud)
904904

905905
static inline int pud_present(pud_t pud)
906906
{
907-
return (pud_raw(pud) & cpu_to_be64(_PAGE_PRESENT));
907+
return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PRESENT));
908908
}
909909

910910
extern struct page *pud_page(pud_t pud);
@@ -951,7 +951,7 @@ static inline int pgd_none(pgd_t pgd)
951951

952952
static inline int pgd_present(pgd_t pgd)
953953
{
954-
return (pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT));
954+
return !!(pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT));
955955
}
956956

957957
static inline pte_t pgd_pte(pgd_t pgd)

0 commit comments

Comments
 (0)