Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp512039imm; Thu, 30 Aug 2018 04:44:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY0wWiNwSYFxIdvPxPQpuOdZncEzuI2nC3TIjzfyXcTxetTd2Cg/+AjwSE0w8/fQhj738mR X-Received: by 2002:a17:902:8481:: with SMTP id c1-v6mr9897641plo.177.1535629496541; Thu, 30 Aug 2018 04:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535629496; cv=none; d=google.com; s=arc-20160816; b=FMEFVL3ng747I5mPrNt2jcxHmYak1uORLxcwbvEZb1wRq47y2IE6i9GbDq8LeJnGsM V8XRpmMp8Iumf93a3kQ/iRIctCDNWR+Pmj4nkVf7dfrDPSJ8lMC9rqtl+btiVsKE+29t uM4QSW+mSbkCVqI3cUg0Pah+U7LN65zu4ZGWHRSZVSKlPk7FjpeOn1pHKuVLdwU8IE8H kR6BBJhbtGDdiE9iof4DXUqOM+Ssb/Z72hQFyFK/nWdzYo5SxwRwAyDprMaGCZDR6KaI HiWJ3dI5sonL5l0Wg40X7fPfLJ4hMpPeyCd38/DfI7A8rFVRfg3tkNAqZ7WF4n35xL5x 01lA== 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:arc-authentication-results; bh=83X0Ly3GNFYkIBH/BFHbUkVhejW7zXmTm47ETsZa+AI=; b=E9baNO0NlM/Q1KlqJBun235RgJdMYnhcV4SAn87081URbp/C3hQPwJ2T62E1gJ2uNp cMTD8BbUII23EVkFGg8PZrxGXAaJz3g4wD9xqucfRznnQcrGHI258RUfgx2sSxrAaPaw QDa/5942AxWLceJonAoml0kRxl39DXPYyJTvLhw62OTvtTgfbnT7JxlAbdh5BQ8N/yNj uCYJSFIGcWylr5xoZKBt55k6PFIRhdKImfOxov3cKu3caso2G6xkrPd3vBxgWO29tUXM guTGlHMGbjeJ2LL0hiijvPP4/p0b9XKALEfnlTnt5hAYNoFqmky0fUtTjx0vB7V/XewF tX3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=K+wpn7aJ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si6424583plc.50.2018.08.30.04.44.41; Thu, 30 Aug 2018 04:44:56 -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=@google.com header.s=20161025 header.b=K+wpn7aJ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728194AbeH3PnI (ORCPT + 99 others); Thu, 30 Aug 2018 11:43:08 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40102 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728047AbeH3PnH (ORCPT ); Thu, 30 Aug 2018 11:43:07 -0400 Received: by mail-wm0-f68.google.com with SMTP id 207-v6so1658614wme.5 for ; Thu, 30 Aug 2018 04:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=83X0Ly3GNFYkIBH/BFHbUkVhejW7zXmTm47ETsZa+AI=; b=K+wpn7aJOFLmPZBtmJEtbDEIz8wwRyqKm90YcGp+HMvxjAN9pVZ9cCtV/gejD6CHx8 CCRwiS6KNOavKWrpApClDZVkUNnM1PpPI0sPj53nn54bQD/sBRG7JsNHHoX4PU66BtJs sWQPtl9p71g3J5ENln6J0XiGFBCetgKOUOzChKveAkosXimFhJVQQlzelgwZoNQSSMrk bcDUcVPQoIRyS/FnXWMTu46L+C5BZMmJ8YmSSpruskuUgtBE+n6hxzvCGEZKPoQmzw5o IloxmtP6GY49QXdlXgn3aXUqKYfzJKfo4M4OVXaCo+jBOHmqanbdshjSYmo4j7v976ox Mgrg== 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=83X0Ly3GNFYkIBH/BFHbUkVhejW7zXmTm47ETsZa+AI=; b=RGZ9yiMXsoQwSOtox2eFzl/oFio5VyPsTyMeyNFYCOJQMwBcUJ9/Y4ZmKTsLIKuCva by2uSFP28197tJF9YfzL7/X2K0Ey/dWilM+08hNUSqFM3CvIqu8bgckJs/QNonoN2H6I qgPDN0aByxUOn6qoPxiPQ2RM+QWeJT5GJViR/Wy0ndhe8xkxj1hK2JeVhnPa02sybTQa lxCzah3vY/4nu8TYx/tcJHrZITsyNHbCoSvF4rV/LcfXuTEj/1O9DXhSFW841VGQEx7v /FXOgnJ+CByVsnFBX0MaxkOehIQni2R+u5vPMTkrdBBHPHZ9MfQnwJzl3HnsnjJPkqPR V9QA== X-Gm-Message-State: APzg51Cc3q0Kr7QplP/ip8clQ4iCBe6IJf8yk62XeQOLN8kzCZBn9287 dC2SuIupLsrwGNsdKgTLOC5gfQ== X-Received: by 2002:a1c:9e4d:: with SMTP id h74-v6mr1596295wme.70.1535629282357; Thu, 30 Aug 2018 04:41:22 -0700 (PDT) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id z184-v6sm2175218wmz.0.2018.08.30.04.41.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 04:41:21 -0700 (PDT) From: Andrey Konovalov To: Catalin Marinas , Will Deacon , Mark Rutland , Robin Murphy , Al Viro , Andrey Konovalov , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Chintan Pandya Subject: [PATCH v6 01/11] arm64: add type casts to untagged_addr macro Date: Thu, 30 Aug 2018 13:41:06 +0200 Message-Id: X-Mailer: git-send-email 2.19.0.rc0.228.g281dcd1b4d0-goog In-Reply-To: References: 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 This patch makes the untagged_addr macro accept all kinds of address types (void *, unsigned long, etc.) and allows not to specify type casts in each place where it is used. This is done by using __typeof__. Signed-off-by: Andrey Konovalov --- arch/arm64/include/asm/uaccess.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h index e66b0fca99c2..2d6451cbaa86 100644 --- a/arch/arm64/include/asm/uaccess.h +++ b/arch/arm64/include/asm/uaccess.h @@ -102,7 +102,8 @@ static inline unsigned long __range_ok(const void __user *addr, unsigned long si * up with a tagged userland pointer. Clear the tag to get a sane pointer to * pass on to access_ok(), for instance. */ -#define untagged_addr(addr) sign_extend64(addr, 55) +#define untagged_addr(addr) \ + ((__typeof__(addr))sign_extend64((__u64)(addr), 55)) #define access_ok(type, addr, size) __range_ok(addr, size) #define user_addr_max get_fs -- 2.19.0.rc0.228.g281dcd1b4d0-goog