Message ID | f3557f02473500f1d8baa7c0fa6bde21a9a13c8d.1524077494.git.andreyknvl@google.com (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 6A7A2601D7 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 18 Apr 2018 18:54:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59351287F2 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 18 Apr 2018 18:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D93C287F4; Wed, 18 Apr 2018 18:54:44 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI 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 95E42287F2 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 18 Apr 2018 18:54:43 +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=oIaO8yA22cZ2YNAL3xi+AmurOZnn8OU6ftGVOC7IfqU=; b=NGp1aOPKWA0g5PSNRQzNZ/Hm/Q sUC28Dua1gL1NIlBzKSlzX8/2UOCrS6Ttux7DIATaKC7eQwu+veiDncv4MFV72rcY2MlThwqd9Zw5 Ysr0DclPyFvJANLkQmuaXvNbFGMGfnARnlzoXWYILTmqfH8CrcpWQdnXCKpIylEDsOJtDE0++dvvS jkpKSqbeaw3thEsCE9d8iHwp4ZGvyO1GSijwv9A/c/BlWZecxC2SQemDkc2n/OuKaUXvxMZVQT4+h mCrOMyw4+QjiBMYuID81DH7FhpgsZa2veIqP9m+AzXGGjUvkcBiRIdBFNjXzU3rRsQVACAvsLNp1F /VteZKEg==; 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 1f8sDt-0003MW-Hv; Wed, 18 Apr 2018 18:54:29 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8sCy-0002uP-6o for linux-arm-kernel@lists.infradead.org; Wed, 18 Apr 2018 18:53:36 +0000 Received: by mail-wr0-x241.google.com with SMTP id u4-v6so7511731wrg.10 for <linux-arm-kernel@lists.infradead.org>; Wed, 18 Apr 2018 11:53:21 -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 :in-reply-to:references; bh=upppdIDGgX4DchLqIIxDa1ACj7PSs1Jc4nEJzkc95m8=; b=YcvbuTuHQTQasRgn+75bEOw/WjWlJrm2p9f3ulUY4yhG4ZjrDgwmBO4Ts8t9t4DQ2h CcvbibYeCeKDUi8beUhiZUHHic51ImmzKtq8AI+d/2UzeZUBw/B5c49Np/+jEv9H9Tv2 jNVzhijqmNRY6HRTV6tP0U0hhOtvsC1hTvPx5tR03dwSDvy9i8ZmK1FQ8xRV+SBhpphc Rwdl5zS55ovlppZKFKNnU97uuPjx9+Iy7w9ZRsw8Q0gMEoZ5pZVx8pBXm7JwjBuHvXhf CXpHmDQQ7h265fAf49raQaM3nxI7WeNvICwTGWMWGiFMcuSLhnXYdcYK9qqyg1gvtCRy vFnw== 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:in-reply-to:references; bh=upppdIDGgX4DchLqIIxDa1ACj7PSs1Jc4nEJzkc95m8=; b=Y++xb0bOYP3GABh9ZNFNXi2nAUg6XLOwKO5S7rrkJFpqzJE38OwF1I7+MJAze0G+H9 Mhapzs+V1ULflnTOy8ROGExI3fIdutkvVGvkL+OJu3T8s5kS2iPGy2Fm8hWHQT1OwrY3 Ly2Y4q9iDBzn59VhoJPdodSCjaTyNNtLV+T0Lxq91j6qZNFAcN/k3x2e+Ilzm9NsTC6v CBf+o2VdTfj2MdKlGWA3YwW/bEecd8iN8/iF8klAZcnylHC7MJJARh4Wwmfqax21Xvx2 wTX34fz31mW/AOfFxb4I67337WFGtQPltFvsZPgZOJHVH5eUmGR4RZEPHjP3mRyPLX63 UZNA== X-Gm-Message-State: ALQs6tCXGjmR9303A3kHyvOJ/7pfbRMutm5OxdjFiNgK8Fffvqr6fi1H xotZ1NZQg1DUsdd86SM5Epeq4Q== X-Google-Smtp-Source: AIpwx4+mCNu3FKyFByPV3u1yjEnA8QViNl6fr0SMUnpjf3SaNtOBhM1DMB4b84D7rEhq1vAwSLRQ9Q== X-Received: by 10.28.177.197 with SMTP id a188mr2390658wmf.121.1524077600112; Wed, 18 Apr 2018 11:53:20 -0700 (PDT) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id k79sm2616735wmg.39.2018.04.18.11.53.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Apr 2018 11:53:19 -0700 (PDT) From: Andrey Konovalov <andreyknvl@google.com> To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Jonathan Corbet <corbet@lwn.net>, Mark Rutland <mark.rutland@arm.com>, Robin Murphy <robin.murphy@arm.com>, Al Viro <viro@zeniv.linux.org.uk>, Andrey Konovalov <andreyknvl@google.com>, James Morse <james.morse@arm.com>, Kees Cook <keescook@chromium.org>, Bart Van Assche <bart.vanassche@wdc.com>, Kate Stewart <kstewart@linuxfoundation.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Thomas Gleixner <tglx@linutronix.de>, Philippe Ombredanne <pombredanne@nexb.com>, Andrew Morton <akpm@linux-foundation.org>, Ingo Molnar <mingo@kernel.org>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, Dan Williams <dan.j.williams@intel.com>, "Aneesh Kumar K . V" <aneesh.kumar@linux.vnet.ibm.com>, Zi Yan <zi.yan@cs.rutgers.edu>, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/6] arm64: add type casts to untagged_addr macro Date: Wed, 18 Apr 2018 20:53:10 +0200 Message-Id: <f3557f02473500f1d8baa7c0fa6bde21a9a13c8d.1524077494.git.andreyknvl@google.com> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog In-Reply-To: <cover.1524077494.git.andreyknvl@google.com> References: <cover.1524077494.git.andreyknvl@google.com> In-Reply-To: <cover.1524077494.git.andreyknvl@google.com> References: <cover.1524077494.git.andreyknvl@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180418_115332_882790_7C10F9FF X-CRM114-Status: GOOD ( 14.63 ) 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: Jacob Bramley <Jacob.Bramley@arm.com>, Ruben Ayrapetyan <Ruben.Ayrapetyan@arm.com>, Lee Smith <Lee.Smith@arm.com>, Kostya Serebryany <kcc@google.com>, Dmitry Vyukov <dvyukov@google.com>, Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>, Evgeniy Stepanov <eugenis@google.com> 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/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
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 <andreyknvl@google.com> --- arch/arm64/include/asm/uaccess.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)