Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1601029ybp; Fri, 11 Oct 2019 17:22:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQF0xPHv4wrIrtdMzE1jZPnVDUTDHoktuxeiRrRItsnEZ/FMjXfhmEBtzed59AeaPUYU2z X-Received: by 2002:aa7:d5d3:: with SMTP id d19mr15971448eds.213.1570839724020; Fri, 11 Oct 2019 17:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570839724; cv=none; d=google.com; s=arc-20160816; b=aOaChk8lV84JQ94bj1Yfd4jzyian+trMjpjz5Z1h9Zl0OfC3zpJioE1bTo8kDxzZyV 0tjWIm5S/LHfhiSFPr1WZKElAptxhBCeAEAIwJvAw4PIebhcOgx2kRT8moJW70hXmqPg kLmVkmmczTVK8Km87NGwqLPIiY0T9YQcoFawDkE6wr85+ZD8v/VwYxhzEkc6sulS58UQ iCLHB9F+WLo/+UfuGP9owpp3C/HvR0edT9JYmItXQiRQuAXpLlGWoib0859vns8PY32W +b0gr0rXSNmMj5rhiJI46uY0qMzYJQ/4Mvzqpz1QFGhJfIhMor5EA9x9/kcG67zEGJ0R gI5g== 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=kjWi0GH8KhuY/mSwjF/Yf4/A/3SkcDswuz7RL6JGBfI=; b=It42kgpohC96E1N8TNJhF5PUHOsKqavDXpB/b2qRRau5jDfHNoL7Lo3SLiH6/5acpD VOsYvdPqKcB5PoR4vv7noXjzITIGazvxlYsZXhpeM3pZUJIoz+NXIDGmy4S2S1/MYiti YJIQEOAjI6epyw3gyFy0a+cGmkh+1c+bFdzT21mE9omb6YIckmm0kiI1WBwt/SiRzE0b AjGbmhqgeoMyZaKi4OcQO3dpy31YBKMuGdhoT9eupcQO2JbRJbzm4My3+WljzJfhbBuv xowdWm/RyQ9qNO1EE8xlhlUYrumgQw043gAFEuMDNf8nwkGOVdgCwAE22/QU/T685Rol vugA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=URInePOr; 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 b15si6682365ejd.66.2019.10.11.17.21.40; Fri, 11 Oct 2019 17:22:04 -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=URInePOr; 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 S1728596AbfJLAHg (ORCPT + 99 others); Fri, 11 Oct 2019 20:07:36 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:37124 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbfJLAHf (ORCPT ); Fri, 11 Oct 2019 20:07:35 -0400 Received: by mail-lf1-f66.google.com with SMTP id w67so8185824lff.4 for ; Fri, 11 Oct 2019 17:07:34 -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=kjWi0GH8KhuY/mSwjF/Yf4/A/3SkcDswuz7RL6JGBfI=; b=URInePOrEmnoQ3aSXGuMmeQ6pfLDeRUtLk+sbV+1CVy8AiVBIX51IPm+uKGAop7u2v 7cGoTbB4p0uzqFdbddu+7sAUhmfegCkfpTU+rZbmzMxnVRl8rA8/PEbD6DSeYcRZGIzx rSlEsbxEGKK6UilrLfKhbmLL0aU650pV8O3NG58H37Q07UPIlQAcgODfF/3ji4BPO1Jg 9xDsiN6NT8A16rAfVexaiuRj4DswDn+/BtNyPloh42kSHKhShngq32QRFSaIcaQaQWgS w0ngF/mqkTWPhyS3WQ+RRkbz4KqZ9kk69zVazjK9yKhYl2LZ+HEMVwcbQfFepw5fkbfN JAOQ== 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=kjWi0GH8KhuY/mSwjF/Yf4/A/3SkcDswuz7RL6JGBfI=; b=t2f0Ate3xdWlmm/oL35ljJ7YM/c4F0Q6erh0WG45RqhitCACZE3zBqzsNWF51WQUdV ww34M5bvNcgCMr/xCEWOBVUXVgC1o+U/BD7SDSPI2KalJ7Pse6QZaU7CwYRIs49rvMSO q+2gtSzCyjExn85X9u+04BQQR2s6ycBth0BtF2LMHat6YLY74gNFwAa+lDC3UCwAVvrQ 5wllR9aDu7UJNYSQGQDe/Qn4r05XmuqkMzjPfuvd+dcLcPdqq3iPapO26obxJqWqMy6N ija02AdnRCFzM0E+4hYv4XipfQLJq+3sMrrJ8lInQmRS/NkuahKf56BGAkfd8S7h+fTs K5ww== X-Gm-Message-State: APjAAAXRg++aWHm+RrRaA9rgKwkc4odi7m3VyFFa2FPn2+7E/kOc0yJ6 Ns/w7Db+ptYLdMDqNkokXAg= X-Received: by 2002:a19:4bcf:: with SMTP id y198mr10078998lfa.168.1570838853636; Fri, 11 Oct 2019 17:07:33 -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 x17sm2215705lji.62.2019.10.11.17.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 17:07:33 -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 2/3] xtensa: clean up assembly arguments in uaccess macros Date: Fri, 11 Oct 2019 17:07:10 -0700 Message-Id: <20191012000711.3775-3-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191012000711.3775-1-jcmvbkbc@gmail.com> References: <20191012000711.3775-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. Signed-off-by: Max Filippov --- 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..aca510707189 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