Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1161970ybi; Fri, 2 Aug 2019 10:18:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwunvqv/MbS2VZeAMm/2t6aFMzhuHrOCNFnj64+zLBrAy3vM7LkZofpo7uE7N1ieD8WMK42 X-Received: by 2002:a65:640d:: with SMTP id a13mr124242275pgv.256.1564766305359; Fri, 02 Aug 2019 10:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564766305; cv=none; d=google.com; s=arc-20160816; b=dJGVPnl1XJ8Fdn4ZZXin7pi5CFqvJoiG8Wyne/1QLf33wKhpuu4ZktzhcXE4p9oZGn KGS6ZkiX6kMEca2yjZNYi1HFMKCxZjvdEC8px+lrGh0q2jHRKWZy0A2QCi7GnUhskDk4 lCPM4KellF5iGTqmzJ+GIUrizGCpZper65y2RQHDdIoZLwdwTvKVuHrADtPlOzqecccR rRdFN3VvwgbOTDdX2hjvoEBEbEt+9CeiNQ/vTO5bEjanF2kQwCkKzN5cGipRCdNUeEJP sWUmC8BZB8ijshYDOHixwCubg2qfcKS4RMJ1lYgdV4UCqFmYaIz3USBvjWqpzQXfW3ZJ YR0A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lOzH5iqi75ral3ZP5CNxRkHwt2nvUvpoUACHbCwC7Uo=; b=fYqY+iUrR5MJdOooDCvaSgASIKd9OfiyeFDMtnDw2EN5jgMUPcVJ6VIB0LDH5hwgfM 51MDOODTTM8F+zCCTxVX7rm70KNoAyhpG2gK334lpIFSim4h7PXRHwB+BjvHkzf/S3jP 0Klajo/4nGnqj45VYv8Tv2y+iaAahTc4G+GR9JimdNXJqDDv2tzQJlBVxnzGvf0SyCFj Nk4JTSm7YuZEKq4gEC4zmcAl5H3XksjzXiwOHneuyTyELkJFoeDp0W2tO9qXBB8T6sBf KxOQ2eL7FNnT37PdlHxxaA+HuXD2ThP9R3iYxUhy0KBFtjyrPR+vFzDb7ZvfRRtQtOr2 UsWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d7lCwHbq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si38214736pgj.239.2019.08.02.10.18.10; Fri, 02 Aug 2019 10:18:25 -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=@kernel.org header.s=default header.b=d7lCwHbq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391393AbfHBJpg (ORCPT + 99 others); Fri, 2 Aug 2019 05:45:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:49326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391942AbfHBJpc (ORCPT ); Fri, 2 Aug 2019 05:45:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5BB032086A; Fri, 2 Aug 2019 09:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739131; bh=iQP2fSg2U+1c6Xp5RHw7ciIsyiz20F1hyTMk5VXWhX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d7lCwHbqUso0LxTtAl0T1OXO8S5aPlCmplViZLfSPI21tcWxXyUNERDbtkWPOAmTi TsZx/7gtMcXqRhaolEhmFj5I+ljNV53LaWTMtWnXjIVYq17XaSOvuuEBLCPfd0tKxC KercnQYst2f+Ervm/ToxjKUx7jfGF8QyP0YRa+Bk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Ryabinin , Linus Torvalds , Sasha Levin Subject: [PATCH 4.9 125/223] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck() Date: Fri, 2 Aug 2019 11:35:50 +0200 Message-Id: <20190802092247.195768384@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit bdb5ac801af3d81d36732c2f640d6a1d3df83826 ] Instead of having two identical __read_once_size_nocheck() functions with different attributes, consolidate all the difference in new macro __no_kasan_or_inline and use it. No functional changes. Signed-off-by: Andrey Ryabinin Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/compiler.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 80a5bc623c47..ced454c03819 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -250,23 +250,21 @@ void __read_once_size(const volatile void *p, void *res, int size) #ifdef CONFIG_KASAN /* - * This function is not 'inline' because __no_sanitize_address confilcts + * We can't declare function 'inline' because __no_sanitize_address confilcts * with inlining. Attempt to inline it may cause a build failure. * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 * '__maybe_unused' allows us to avoid defined-but-not-used warnings. */ -static __no_sanitize_address __maybe_unused -void __read_once_size_nocheck(const volatile void *p, void *res, int size) -{ - __READ_ONCE_SIZE; -} +# define __no_kasan_or_inline __no_sanitize_address __maybe_unused #else -static __always_inline +# define __no_kasan_or_inline __always_inline +#endif + +static __no_kasan_or_inline void __read_once_size_nocheck(const volatile void *p, void *res, int size) { __READ_ONCE_SIZE; } -#endif static __always_inline void __write_once_size(volatile void *p, void *res, int size) { -- 2.20.1