Message ID | 20180325180959.28008-7-stefan@agner.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A1F18600CC for <patchwork-linux-arm@patchwork.kernel.org>; Sun, 25 Mar 2018 23:15:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95F2729139 for <patchwork-linux-arm@patchwork.kernel.org>; Sun, 25 Mar 2018 23:15:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A74129158; Sun, 25 Mar 2018 23:15:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E806229139 for <patchwork-linux-arm@patchwork.kernel.org>; Sun, 25 Mar 2018 23:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=52TnkkFD9lZfLqc7neZ+EYJEA3YjPEp4YJufj+IACqU=; b=Ois9L/SMbND6BDkMJCd5h9Zxt8 8W2rRftvIWsmZ0tq1r/IoWv2+i8yhl/hh9oxJ1ej0LWBPnekagblp+WHcm1i1BanBKqRmlW4SC/p+ GHYDTEnxIuNnOU7ZTtXc36dhsI3pXuDhlIa60YdXfS55q03GISYz3RJn54oYf9PorR9MdRo3zC0UR c8ycRil+aZ+W2/Iw+slC/F8KqNmQo4T7qF8JbUp9l8suhDZ3zRq26C+f9vw6jssAzWXXl/q+5w+eF WMfBOKZKPJSrGsEo5X6VnEWDx7OtfhyeP4Zpt29eRTDCHZIj5iDjLkzIEm6G9O1D2SYKp2r+Guinj yTkNvelg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0ErR-0004XK-RI; Sun, 25 Mar 2018 23:15:37 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0EmB-0006ba-6w for linux-arm-kernel@bombadil.infradead.org; Sun, 25 Mar 2018 23:10:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=F6OAwV2hwIiZBhgimnKcc2cTJS48RFPZDA+4Z5AEng0=; b=Mor1skV29ZLf3plLsbpulZzn6 eYn3V2zpcR9cPKwOiphOX864fpVUwBUKp1vGdOOSTE5rSpyEzLHK9ZLwNqCN1j+8ksw/VF85y/p7U WRGAujCzJ6dYQMUMfbuu3cPLGT/cuMwyvj9GJbZrhhrGMKM/CM9fgsw2Kh4k8usQyjjOEn3aXYRcL n+Hdgq6ZTVh5s3tddY2vKpz78HfiS/rCVqIH03slfVelbKC6+NGueIFT6YoCVuoMIL2wYD/+DInZG wS0849AfgdDa5hWLUtLDSSCdlKrD0CRxlyauu4vOhZQJCVbXOrUVNixfgytSnUjgkPA/shaHndM6m E3k4t8+nQ==; Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0A7i-0005rX-E2 for linux-arm-kernel@lists.infradead.org; Sun, 25 Mar 2018 18:12:07 +0000 Received: from trochilidae.lan (unknown [IPv6:2001:1620:c6e:0:814c:3584:bd88:6cb6]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 673445C1FBE; Sun, 25 Mar 2018 20:09:37 +0200 (CEST) From: Stefan Agner <stefan@agner.ch> To: linux@armlinux.org.uk, ard.biesheuvel@linaro.org, arnd@arndb.de Subject: [PATCH v2 6/6] ARM: uaccess: remove const to avoid duplicate specifier Date: Sun, 25 Mar 2018 20:09:59 +0200 Message-Id: <20180325180959.28008-7-stefan@agner.ch> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180325180959.28008-1-stefan@agner.ch> References: <20180325180959.28008-1-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1522001377; bh=F6OAwV2hwIiZBhgimnKcc2cTJS48RFPZDA+4Z5AEng0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=X84V4kmeWKlVyaJ3fjg07HuZ3M+QDIjlJXJ0l0UFtKxCtvsuqzTXTzFtouK7sDQn2cH3zegS1zKQhkkDKA1NXQvzV0dLG7jKpHbf5C9mb9jVzqUhJlXCf6UleBgfV9FBfsvK08U2tFVPFKjZ2H9YcyrqFQao9+gXgivnpvxyYrQ= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180325_141206_589794_F7D6F103 X-CRM114-Status: GOOD ( 15.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: nicolas.pitre@linaro.org, keescook@chromium.org, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, Stefan Agner <stefan@agner.ch>, mka@chromium.org, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org, Bernhard.Rosenkranzer@linaro.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 0bf2347495f1..3d614e90c19f 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -152,7 +152,7 @@ extern int __get_user_64t_4(void *); #define __get_user_check(x, p) \ ({ \ unsigned long __limit = current_thread_info()->addr_limit - 1; \ - register const typeof(*(p)) __user *__p asm("r0") = (p);\ + register typeof(*(p)) __user *__p asm("r0") = (p); \ register typeof(x) __r2 asm("r2"); \ register unsigned long __l asm("r1") = __limit; \ register int __e asm("r0"); \
Some users of get_user use the macro with an argument p which is already specified as static. When using clang this leads to a duplicate specifier: CC arch/arm/kernel/process.o In file included from init/do_mounts.c:15: In file included from ./include/linux/tty.h:7: In file included from ./include/uapi/linux/termios.h:6: In file included from ./arch/arm/include/generated/uapi/asm/termios.h:1: ./include/asm-generic/termios.h:25:6: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] if (get_user(tmp, &termio->c_iflag) < 0) ^ ./arch/arm/include/asm/uaccess.h:195:3: note: expanded from macro 'get_user' __get_user_check(x, p); \ ^ ./arch/arm/include/asm/uaccess.h:155:12: note: expanded from macro '__get_user_check' register const typeof(*(p)) __user *__p asm("r0") = (p);\ Remove the const attribute from the register declaration to avoid the duplicate const specifier. In a test with ptrace.c and traps.c (both using get_user with non-const arguments for p) the generated code was exactly the same. Signed-off-by: Stefan Agner <stefan@agner.ch> --- Similar issue has already been discussed here: https://patchwork.kernel.org/patch/9693821/ arch/arm/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)