Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5221084ybp; Mon, 14 Oct 2019 17:55:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxN3OTo7Z3nPupIFnEoj1RMkeH6zeWDg8gQCgeE9tj6YHJhPOezRqGsEf80CgZrdWOoYuG3 X-Received: by 2002:a17:906:2c5b:: with SMTP id f27mr30741775ejh.239.1571100946008; Mon, 14 Oct 2019 17:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571100946; cv=none; d=google.com; s=arc-20160816; b=QqK9WQipvpRWCbpZGwhHKkJltf7lwZcfd2oaYpcoMUNmKyoDOw16sUWeoQxBxLrdqf RKyb1pfaRfgjKbFRNkAnBUI5fYBu69v7CtzKWOC6XM4mRSfJeMOhOdz5zsLgphXlyFBA RpJ66wlE78Xo+D6WBUruYBd7gS0K3S3FdFW9+qg+chHO+6+ijobDva9v+tTHRwVZKf90 13arEIje6bXNDsj3TMA6YFArqteTwoW98JWNfGs/fo9E/iaJ8EBs7o2C6p/5ShrGU3Vc qq1fFuLYSYd3Zn4Dl9JxciE1epTPbWHWpZqzV1co1R4ED+aURE+XtxeSFXqtk9T0Kwyd hYSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DEgyVkL1sRyTaJ07rFVWXkm6zQa7bcNVlWuViQ4TgNU=; b=whA9pVlPulwoFNaGMV+l/NoIhV4n0WJUplZfsOcxypPcaXNqawGdlACNEHJaRClL97 5hS7sLqQyPCGDKDdYTZp8J772p2ARCZMvIICbj25cQgm75yKShVmFGzupcBTkYMVXw+Z 6020/66ER3kaGYZTQK58BqCwVGHXmtm8jSS5K1iHj3IFWIK0u4FuLxrNY+viCMVQeXco lf3LDrkFLoi44H4TQW8nQzqN+pebRXwk90oDm1hL7DRhPys/qoacUx/E4VimrAC3VlT7 iGh6WZLWzGed+xdswS0Ep4mchSjPTGgqJhfaivdWmj6H0fLE1fmvmh5oswOVUIh/Ntji WR+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p4x27pY5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si13435079edd.305.2019.10.14.17.55.23; Mon, 14 Oct 2019 17:55:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p4x27pY5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732178AbfJNVZq (ORCPT + 99 others); Mon, 14 Oct 2019 17:25:46 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42486 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731950AbfJNVZp (ORCPT ); Mon, 14 Oct 2019 17:25:45 -0400 Received: by mail-lj1-f195.google.com with SMTP id y23so18000365lje.9 for ; Mon, 14 Oct 2019 14:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DEgyVkL1sRyTaJ07rFVWXkm6zQa7bcNVlWuViQ4TgNU=; b=p4x27pY5o1BRq8AMo8WFS8GZ6D0eaSL/VI0BXPX27bftuxZPW7jpu1H7GGEAc2szhU 7BgOUad4M9W1l5TXn2ONUnxEiiH3nZKhpj5pE/nzgH0smDp9+db17IF1N226dphGLmzp fpgny4cDX38i3hGPi2IDnZy6lAky4o6W1uccekOtQlP0mzgVFeIyd7TWpgHkeA5OuIzT TR8UdBQ70X/oLmA6ibzzjLIPhXYiysKXaDrXjKityi4Iohj/2KOk2cckpalix+QLP/Xw k3j+fU9Qkw93fX31y0k5+hYfUO2xjzMwc+aS1Z8rF/EBmjHSsIPOokVdVnrTd1GOtWkr GGFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DEgyVkL1sRyTaJ07rFVWXkm6zQa7bcNVlWuViQ4TgNU=; b=l9Jr2+h1fuRNQAxEt1fsijo8uN5qFzMTd5+M3H/GusDGtfmYidWd+rkFanUpDEHNlX 6rnvIw14WLxEL8TKPaPDPdHTqUb1pQUVVrlYrjbnMe/yzmKmKsRiKq37zgNomCOXoo6K V56k99qgvzuG83rXzFut/DzY/2fvLMIn73KHiE/urDDDxJs9fmdKoMZkX/EhK7A+qvD0 03kk/PlTUZzfIRC9xAf420xYltvghH2MtkoSsXkc+Ti1KiK+B5SOTBvLtU8vug58dyV7 vEjDZGDIDwHrrhXOdaAKGY/pf57TeUz3wkyuM4x0euLZngtlbF+T3/cdynMj86xSRiid fDVg== X-Gm-Message-State: APjAAAVP1XLFPEtGX7D+1WbucFGpWzWuvebxOhrsjTj0ny7BbJTaoIt2 Ic2hKXd4qP5xBHpBokE3h2g= X-Received: by 2002:a2e:9151:: with SMTP id q17mr7797001ljg.115.1571088341828; Mon, 14 Oct 2019 14:25:41 -0700 (PDT) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id m15sm4429434ljh.50.2019.10.14.14.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 14:25:41 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org, Al Viro Cc: Chris Zankel , linux-kernel@vger.kernel.org, Max Filippov Subject: [PATCH v3 2/3] xtensa: clean up assembly arguments in uaccess macros Date: Mon, 14 Oct 2019 14:25:12 -0700 Message-Id: <20191014212513.17661-3-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191014212513.17661-1-jcmvbkbc@gmail.com> References: <20191014212513.17661-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Numeric assembly arguments are hard to understand and assembly code that uses them is hard to modify. Use named arguments in __check_align_*, __get_user_asm and __put_user_asm. Modify macro parameter names so that they don't affect argument names. Use '+' constraint for the [err] argument instead of having it as both input and output. Signed-off-by: Max Filippov --- Changes v2->v3: - fix assembly argument constraint for error code arch/xtensa/include/asm/uaccess.h | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index f568c00392ec..da4d35445063 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h @@ -132,14 +132,14 @@ do { \ #define __check_align_1 "" #define __check_align_2 \ - " _bbci.l %3, 0, 1f \n" \ - " movi %0, %4 \n" \ + " _bbci.l %[addr], 0, 1f \n" \ + " movi %[err], %[efault] \n" \ " _j 2f \n" #define __check_align_4 \ - " _bbsi.l %3, 0, 0f \n" \ - " _bbci.l %3, 1, 1f \n" \ - "0: movi %0, %4 \n" \ + " _bbsi.l %[addr], 0, 0f \n" \ + " _bbci.l %[addr], 1, 1f \n" \ + "0: movi %[err], %[efault] \n" \ " _j 2f \n" @@ -151,24 +151,24 @@ do { \ * WARNING: If you modify this macro at all, verify that the * __check_align_* macros still work. */ -#define __put_user_asm(x, addr, err, align, insn, cb) \ +#define __put_user_asm(x_, addr_, err_, align, insn, cb)\ __asm__ __volatile__( \ __check_align_##align \ - "1: "insn" %2, %3, 0 \n" \ + "1: "insn" %[x], %[addr], 0 \n" \ "2: \n" \ " .section .fixup,\"ax\" \n" \ " .align 4 \n" \ " .literal_position \n" \ "5: \n" \ - " movi %1, 2b \n" \ - " movi %0, %4 \n" \ - " jx %1 \n" \ + " movi %[tmp], 2b \n" \ + " movi %[err], %[efault] \n" \ + " jx %[tmp] \n" \ " .previous \n" \ " .section __ex_table,\"a\" \n" \ " .long 1b, 5b \n" \ " .previous" \ - :"=r" (err), "=r" (cb) \ - :"r" ((int)(x)), "r" (addr), "i" (-EFAULT), "0" (err)) + :[err] "+r"(err_), [tmp] "=r"(cb) \ + :[x] "r"(x_), [addr] "r"(addr_), [efault] "i"(-EFAULT)) #define __get_user_nocheck(x, ptr, size) \ ({ \ @@ -217,25 +217,25 @@ do { \ * WARNING: If you modify this macro at all, verify that the * __check_align_* macros still work. */ -#define __get_user_asm(x, addr, err, align, insn, cb) \ -__asm__ __volatile__( \ +#define __get_user_asm(x_, addr_, err_, align, insn, cb) \ +__asm__ __volatile__( \ __check_align_##align \ - "1: "insn" %2, %3, 0 \n" \ + "1: "insn" %[x], %[addr], 0 \n" \ "2: \n" \ " .section .fixup,\"ax\" \n" \ " .align 4 \n" \ " .literal_position \n" \ "5: \n" \ - " movi %1, 2b \n" \ - " movi %2, 0 \n" \ - " movi %0, %4 \n" \ - " jx %1 \n" \ + " movi %[tmp], 2b \n" \ + " movi %[x], 0 \n" \ + " movi %[err], %[efault] \n" \ + " jx %[tmp] \n" \ " .previous \n" \ " .section __ex_table,\"a\" \n" \ " .long 1b, 5b \n" \ " .previous" \ - :"=r" (err), "=r" (cb), "=r" (x) \ - :"r" (addr), "i" (-EFAULT), "0" (err)) + :[err] "+r"(err_), [tmp] "=r"(cb), [x] "=r"(x_)\ + :[addr] "r"(addr_), [efault] "i"(-EFAULT)) /* -- 2.20.1