From patchwork Fri Sep 14 04:06:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 969614 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42BMhD6zPwz9s9N for ; Fri, 14 Sep 2018 14:18:20 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WkZIrmp9"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42BMhD5PMHzF3Td for ; Fri, 14 Sep 2018 14:18:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WkZIrmp9"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WkZIrmp9"; dkim-atps=neutral Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42BMRn2TPyzF3Tv for ; Fri, 14 Sep 2018 14:07:33 +1000 (AEST) Received: by mail-pf1-x444.google.com with SMTP id k19-v6so3665066pfi.1 for ; Thu, 13 Sep 2018 21:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=BGsDFYy15U0afT1kaNpGxXqPLg3QPnOKfg3l0uIVDLQ=; b=WkZIrmp931JWRQKfERwHgNynfDasWizgJq14p+zeSlGdHdr3TnC5B4WThozgDb5RuU ebSlTf39NuBkpKR37IkuarjLHDJVnpis4+6TOsLXWiugh+5uU2sf+cnVo0NXGtnzpYmQ XcjJUxr4THBtJIOsMjBZ195X8pOq3JrzMT4pi0a911wPPus79JddHh8prjdBRC3EME0g 5c1SnQ9e6vP/eOtGp6QVwCR0fguq5w4AvEzWUR5qcAojbYK/t9WeX5OK/UWUsqXiwJuh g9Or5sU2Bb0CPm3WW/yk7+ZWMxXoiB21JWfoFcGrBr5DzDQiHL6NJ4rK0NH5jVaZ25yn tZxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=BGsDFYy15U0afT1kaNpGxXqPLg3QPnOKfg3l0uIVDLQ=; b=kk0QCc+eEjpRCZUhkOFkp/jfFQgoFid85nkofO1yCZKzDJZZQDW9Aa7WzcVpbecWST mKZr0Kb1zoKpnw0h1PS6WyRRBxjzJ4AHptfE8eLxa19imsu3rk3EtXJPbMk5ODMqZ7A9 P9B1iMfk6p4bUdu1oJ3pmOCtRQibfWC25rrk+N7voPOJnxK1htn3FJQLIyeVZf+iaA1l BnG7WzQ8115vNmXMpFi5LOjVG1G9VQY9xE4fn7blq+gv+KIsKY52R7ciqbAnl5quPP2h oZC8gTUr2koBYfe3+xK7+YOWQN/xKHd8dg2VXTx86sWyNjF2aDJJ0G3IlEBPRo9S0K6m qjeQ== X-Gm-Message-State: APzg51AF4/BzqACGmdnSZ4k421CXd9xyhmFp4/CUcJIvBdG11Q7BYZGM yjRXKT2mKBlgl2vtH0jFuGFCo2LH X-Google-Smtp-Source: ANB0VdYltQaacI7IcljeE+X9dVyKgMgKV/kAfCxfpuK/gViJqPYgQOdlEqWpxCNug9hiChDblnaxpg== X-Received: by 2002:a63:fc07:: with SMTP id j7-v6mr9719512pgi.1.1536898051054; Thu, 13 Sep 2018 21:07:31 -0700 (PDT) Received: from aurora.jms.id.au ([45.124.203.15]) by smtp.gmail.com with ESMTPSA id d19-v6sm10258966pfe.42.2018.09.13.21.07.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Sep 2018 21:07:30 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Fri, 14 Sep 2018 13:37:24 +0930 From: Joel Stanley To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 4/5] powerpc: Fix duplicate const clang warning in user access code Date: Fri, 14 Sep 2018 13:36:48 +0930 Message-Id: <20180914040649.1794-5-joel@jms.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180914040649.1794-1-joel@jms.id.au> References: <20180914040649.1794-1-joel@jms.id.au> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nick Desaulniers , Anton Blanchard Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Anton Blanchard This re-applies b91c1e3e7a6f which was reverted in f2ca80905929 d466f6c5cac1 f84ed59a612d (powerpc/sparse: Constify the address pointer ..."). We see a large number of duplicate const errors in the user access code when building with llvm/clang: include/linux/pagemap.h:576:8: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] ret = __get_user(c, uaddr); The problem is we are doing const __typeof__(*(ptr)), which will hit the warning if ptr is marked const. Removing const does not seem to have any effect on GCC code generation. Signed-off-by: Anton Blanchard Signed-off-by: Joel Stanley Reviewed-by: Nick Desaulniers --- If we don't want to apply this, other options are suppressing the warning, or wait for a fix to land in clang (https://github.com/ClangBuiltLinux/linux/issues/52). --- arch/powerpc/include/asm/uaccess.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index bac225bb7f64..15bea9a0f260 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -260,7 +260,7 @@ do { \ ({ \ long __gu_err; \ __long_type(*(ptr)) __gu_val; \ - const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ + __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ __chk_user_ptr(ptr); \ if (!is_kernel_addr((unsigned long)__gu_addr)) \ might_fault(); \ @@ -274,7 +274,7 @@ do { \ ({ \ long __gu_err = -EFAULT; \ __long_type(*(ptr)) __gu_val = 0; \ - const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ + __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ might_fault(); \ if (access_ok(VERIFY_READ, __gu_addr, (size))) { \ barrier_nospec(); \ @@ -288,7 +288,7 @@ do { \ ({ \ long __gu_err; \ __long_type(*(ptr)) __gu_val; \ - const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ + __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ __chk_user_ptr(ptr); \ barrier_nospec(); \ __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \