2022-12-26 09:38:29

by Lorenzo Stoakes

[permalink] [raw]
Subject: [PATCH v3 3/5] m68k/mm/motorola: specify pmd_page() type

Failing to specify a specific type here breaks anything that relies on the type
being explicitly known, such as page_folio().

Make explicit the type of null pointer returned here.

Signed-off-by: Lorenzo Stoakes <[email protected]>
---
arch/m68k/include/asm/motorola_pgtable.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/include/asm/motorola_pgtable.h b/arch/m68k/include/asm/motorola_pgtable.h
index 7ac3d64c6b33..562b54e09850 100644
--- a/arch/m68k/include/asm/motorola_pgtable.h
+++ b/arch/m68k/include/asm/motorola_pgtable.h
@@ -124,7 +124,7 @@ static inline void pud_set(pud_t *pudp, pmd_t *pmdp)
* expects pmd_page() to exists, only to then DCE it all. Provide a dummy to
* make the compiler happy.
*/
-#define pmd_page(pmd) NULL
+#define pmd_page(pmd) ((struct page *)NULL)


#define pud_none(pud) (!pud_val(pud))
--
2.39.0


2022-12-27 09:45:16

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v3 3/5] m68k/mm/motorola: specify pmd_page() type

On Mon, Dec 26, 2022 at 9:45 AM Lorenzo Stoakes <[email protected]> wrote:
> Failing to specify a specific type here breaks anything that relies on the type
> being explicitly known, such as page_folio().
>
> Make explicit the type of null pointer returned here.
>
> Signed-off-by: Lorenzo Stoakes <[email protected]>

Acked-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2023-01-12 11:47:26

by Vlastimil Babka

[permalink] [raw]
Subject: Re: [PATCH v3 3/5] m68k/mm/motorola: specify pmd_page() type

On 12/26/22 09:44, Lorenzo Stoakes wrote:
> Failing to specify a specific type here breaks anything that relies on the type
> being explicitly known, such as page_folio().
>
> Make explicit the type of null pointer returned here.
>
> Signed-off-by: Lorenzo Stoakes <[email protected]>

Acked-by: Vlastimil Babka <[email protected]>

> ---
> arch/m68k/include/asm/motorola_pgtable.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/m68k/include/asm/motorola_pgtable.h b/arch/m68k/include/asm/motorola_pgtable.h
> index 7ac3d64c6b33..562b54e09850 100644
> --- a/arch/m68k/include/asm/motorola_pgtable.h
> +++ b/arch/m68k/include/asm/motorola_pgtable.h
> @@ -124,7 +124,7 @@ static inline void pud_set(pud_t *pudp, pmd_t *pmdp)
> * expects pmd_page() to exists, only to then DCE it all. Provide a dummy to
> * make the compiler happy.
> */
> -#define pmd_page(pmd) NULL
> +#define pmd_page(pmd) ((struct page *)NULL)
>
>
> #define pud_none(pud) (!pud_val(pud))