Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbdLIQY2 convert rfc822-to-8bit (ORCPT ); Sat, 9 Dec 2017 11:24:28 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:6098 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbdLIQY1 (ORCPT ); Sat, 9 Dec 2017 11:24:27 -0500 From: Christophe Leroy To: Al Viro Cc: linux-kernel@vger.kernel.org Subject: [PATCH] lib/usercopy: fix sparse errors Message-Id: <20171209162424.E5CEF41C4C@localhost.localdomain> Date: Sat, 9 Dec 2017 17:24:24 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Antivirus: Avast (VPS 171209-0, 09/12/2017), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1822 Lines: 42 CHECK lib/usercopy.c lib/usercopy.c:26:13: warning: incorrect type in argument 1 (different address spaces) lib/usercopy.c:26:13: expected void const volatile [noderef] * lib/usercopy.c:26:13: got void *to lib/usercopy.c:27:34: warning: incorrect type in argument 1 (different address spaces) lib/usercopy.c:27:34: expected void const volatile *p lib/usercopy.c:27:34: got void const [noderef] *from lib/usercopy.c:28:38: warning: incorrect type in argument 1 (different address spaces) lib/usercopy.c:28:38: expected void [noderef] *to lib/usercopy.c:28:38: got void *to lib/usercopy.c:28:42: warning: incorrect type in argument 2 (different address spaces) lib/usercopy.c:28:42: expected void const *from lib/usercopy.c:28:42: got void const [noderef] *from lib/usercopy.c:23:15: error: symbol '_copy_to_user' redeclared with different type (originally declared at ./include/linux/uaccess.h:140) - incompatible argument 1 (different address spaces) CC lib/usercopy.o Fixes: d597580d37377 ("generic ...copy_..._user primitives") Signed-off-by: Christophe Leroy --- lib/usercopy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/usercopy.c b/lib/usercopy.c index 15e2e6f..3744b2a 100644 --- a/lib/usercopy.c +++ b/lib/usercopy.c @@ -20,7 +20,7 @@ EXPORT_SYMBOL(_copy_from_user); #endif #ifndef INLINE_COPY_TO_USER -unsigned long _copy_to_user(void *to, const void __user *from, unsigned long n) +unsigned long _copy_to_user(void __user *to, const void *from, unsigned long n) { might_fault(); if (likely(access_ok(VERIFY_WRITE, to, n))) { -- 2.2.2 --- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus