From d847517950f07353c1195de098c25024f948fe37 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 17 Apr 2023 14:56:39 +0200 Subject: arch/m68k: Merge variants of fb_pgprotect() into single function Merge all variants of fb_pgprotect() into a single function body. There are two different cases for MMU systems. For non-MMU systems, the function body will be empty. No functional changes, but this will help with the switch to . Signed-off-by: Thomas Zimmermann Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-8-tzimmermann@suse.de --- arch/m68k/include/asm/fb.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'arch/m68k/include/asm') diff --git a/arch/m68k/include/asm/fb.h b/arch/m68k/include/asm/fb.h index b86c6e2e26dd..4f96989922af 100644 --- a/arch/m68k/include/asm/fb.h +++ b/arch/m68k/include/asm/fb.h @@ -7,17 +7,13 @@ #include #include -#ifdef CONFIG_MMU -#ifdef CONFIG_SUN3 static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, unsigned long off) { +#ifdef CONFIG_MMU +#ifdef CONFIG_SUN3 pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE; -} #else -static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, - unsigned long off) -{ if (CPU_IS_020_OR_030) pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030; if (CPU_IS_040_OR_060) { @@ -25,11 +21,9 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, /* Use no-cache mode, serialized */ pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S; } -} #endif /* CONFIG_SUN3 */ -#else -#define fb_pgprotect(...) do {} while (0) #endif /* CONFIG_MMU */ +} static inline int fb_is_primary_device(struct fb_info *info) { -- cgit From db21647767db268cebc4a244c61700aeb4a0b17d Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 17 Apr 2023 14:56:40 +0200 Subject: arch/m68k: Implement with generic helpers Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. v2: * provide empty fb_pgprotect() on non-MMU systems Signed-off-by: Thomas Zimmermann Cc: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-9-tzimmermann@suse.de --- arch/m68k/include/asm/fb.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'arch/m68k/include/asm') diff --git a/arch/m68k/include/asm/fb.h b/arch/m68k/include/asm/fb.h index 4f96989922af..24273fc7ad91 100644 --- a/arch/m68k/include/asm/fb.h +++ b/arch/m68k/include/asm/fb.h @@ -2,11 +2,11 @@ #ifndef _ASM_FB_H_ #define _ASM_FB_H_ -#include -#include #include #include +struct file; + static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, unsigned long off) { @@ -24,10 +24,8 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, #endif /* CONFIG_SUN3 */ #endif /* CONFIG_MMU */ } +#define fb_pgprotect fb_pgprotect -static inline int fb_is_primary_device(struct fb_info *info) -{ - return 0; -} +#include #endif /* _ASM_FB_H_ */ -- cgit