]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
riscv: Add pgprot_writecombine/device and PAGE_SHARED defination if NOMMU
authorKefeng Wang <wangkefeng.wang@huawei.com>
Mon, 11 May 2020 02:19:54 +0000 (10:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:23:07 +0000 (08:23 +0200)
[ Upstream commit fa8174aa225fe3d53b37552e5066e6f0301dbabd ]

Some drivers use PAGE_SHARED, pgprot_writecombine()/pgprot_device(),
add the defination to fix build error if NOMMU.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/include/asm/mmio.h
arch/riscv/include/asm/pgtable.h

index a2c809df2733f52238e227331b5bc7679dcc1534..56053c9838b2fcdafd09f7e90b3b0d143e3ffad2 100644 (file)
@@ -16,6 +16,8 @@
 
 #ifndef CONFIG_MMU
 #define pgprot_noncached(x)    (x)
+#define pgprot_writecombine(x) (x)
+#define pgprot_device(x)       (x)
 #endif /* CONFIG_MMU */
 
 /* Generic IO read/write.  These perform native-endian accesses. */
index 393f2014dfeed0aab02a0292fb5b32a860560a8e..05b92987f5001417774bb320250bcaf42c34a51e 100644 (file)
@@ -460,6 +460,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
 
 #else /* CONFIG_MMU */
 
+#define PAGE_SHARED            __pgprot(0)
 #define PAGE_KERNEL            __pgprot(0)
 #define swapper_pg_dir         NULL
 #define VMALLOC_START          0