arch/m68k: Merge variants of fb_pgprotect() into single function
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 17 Apr 2023 12:56:39 +0000 (14:56 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 20 Apr 2023 08:04:37 +0000 (10:04 +0200)
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 <asm-generic/fb.h>.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-8-tzimmermann@suse.de
arch/m68k/include/asm/fb.h

index b86c6e2e26ddc04f8197a516b333b9e32771da28..4f96989922af0af181b292c0d9d723552ba92e69 100644 (file)
@@ -7,17 +7,13 @@
 #include <asm/page.h>
 #include <asm/setup.h>
 
-#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)
 {