From 76367a52d3cbf78f254fee0479824014c8dfb4dc Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Thu, 11 Dec 2014 10:36:42 +0800 Subject: [PATCH 1/3] nios2: add definition of ioremap_wc to io.h Fix drivers/gpu/drm/drm_bufs.c: In function 'drm_addmap_core': drivers/gpu/drm/drm_bufs.c:213:5: error: implicit declaration of function 'ioremap_wc' seen when building nios2:allmodconfig. Signed-off-by: Guenter Roeck Acked-by: Ley Foon Tan --- arch/nios2/include/asm/io.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index 9102bfd3fa1c..6e24d7cceb0c 100644 --- a/arch/nios2/include/asm/io.h +++ b/arch/nios2/include/asm/io.h @@ -45,6 +45,8 @@ static inline void iounmap(void __iomem *addr) __iounmap(addr); } +#define ioremap_wc ioremap_nocache + /* Pages to physical address... */ #define page_to_phys(page) virt_to_phys(page_to_virt(page)) #define page_to_bus(page) page_to_virt(page) From d1e4ef04244fc67f4f2ee001a84a6562f569f437 Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Thu, 11 Dec 2014 10:49:36 +0800 Subject: [PATCH 2/3] nios2: enable "make defconfig" Running "make defconfig" currently fails for nios2: $ make ARCH=nios2 defconfig scripts/kconfig/conf --defconfig Kconfig *** *** Can't find default configuration "arch/nios2/defconfig"! *** make[1]: *** [defconfig] Error 1 make: *** [defconfig] Error 2 Add a definition for KBUILD_DEFCONFIG to the nios2's main Makefile to enable this make target. Signed-off-by: Paul Bolle Acked-by: Ley Foon Tan --- arch/nios2/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/nios2/Makefile b/arch/nios2/Makefile index e142c9ee51fa..2328f82ba2a8 100644 --- a/arch/nios2/Makefile +++ b/arch/nios2/Makefile @@ -14,6 +14,8 @@ # Nios2 port by Wind River Systems Inc trough: # fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com +KBUILD_DEFCONFIG := 3c120_defconfig + UTS_SYSNAME = Linux export MMU From f1f2eac9124bf0dc82b652871f9a596bce2d3e10 Mon Sep 17 00:00:00 2001 From: Ley Foon Tan Date: Wed, 17 Dec 2014 13:53:41 +0800 Subject: [PATCH 3/3] nios2/uaccess: fix sparse errors virtio wants to read bitwise types from userspace using get_user. At the moment this triggers sparse errors, since the value is passed through an integer. Fix that up using __force. Suggested-by: Michael S. Tsirkin Signed-off-by: Ley Foon Tan --- arch/nios2/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/nios2/include/asm/uaccess.h b/arch/nios2/include/asm/uaccess.h index acedc0a2860e..caa51ff85a3c 100644 --- a/arch/nios2/include/asm/uaccess.h +++ b/arch/nios2/include/asm/uaccess.h @@ -168,7 +168,7 @@ do { \ const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ unsigned long __gu_val; \ __get_user_common(__gu_val, sizeof(*(ptr)), __gu_ptr, __gu_err);\ - (x) = (__typeof__(x))__gu_val; \ + (x) = (__force __typeof__(x))__gu_val; \ __gu_err; \ }) @@ -180,7 +180,7 @@ do { \ if (access_ok(VERIFY_READ, __gu_ptr, sizeof(*__gu_ptr))) \ __get_user_common(__gu_val, sizeof(*__gu_ptr), \ __gu_ptr, __gu_err); \ - (x) = (__typeof__(x))__gu_val; \ + (x) = (__force __typeof__(x))__gu_val; \ __gu_err; \ })