Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3785697ybi; Mon, 29 Jul 2019 12:35:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU2EGANmu/soFhiyyj9UPzT7xSn1w7eERIKEPoRhvNmEXnhqU2ySwOrLl/lGdXQdrxI8py X-Received: by 2002:a63:e213:: with SMTP id q19mr104275270pgh.180.1564428909630; Mon, 29 Jul 2019 12:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428909; cv=none; d=google.com; s=arc-20160816; b=TNZRqPl7IvW5gnyTmBvyy8MnAj3qDhMBoDv9aNx+1ZL1CoCfEkgC1mo8gSDu7crUfi z34xkpjUnAPFDAk9VKKcnLaGSxaOnYyMJP2u3IeDAsEEbsTmcP9LxB4P0kEZ53FUbrzP EQ3fHiBjoCxzb/5RvjQgu3BzpU1a6cig6sEyxZ8ALtRV/KeJtqiAmIJ2bKRw3+m8NPci jY/SBGKi1HxvLkgjOD1iogBshfMgeCRYmCAIALko343SZlOntSmR439avx3WLtEU0lGu +l0XUWeUFg4VQCLFbMICxdVTw1p4/NmQmZxsSafLqZ+EqFjby/1H0KaqAnJq36nkietL Us0g== 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=7dLVfixopCYaX0bqHfC4Y8b6Ul516AupxG5S+yZyunE=; b=SWbUvKO0NhJvpe5Jk2PrExd2DK59wlU5rYRmzY/KNT/qCVWhLXyjmkDFbDEf+RJiRO 5ii9UrAYV6nlyKF/6JQHUVirA824RHPSiou3sbIdKVpDFwZFX60mdPm5y+6gaRQZ4igQ /ptWEfTV3DE42x4Rc9UtsjMGmSh2pWZBk09Olgh8qbYacyQ88iwWHrlnVt77u91CegV0 z/dTnEQiHmEloTwWhUZRpHWiLcauYSZ5JjAsb/kP36IeE+7ej0NRJgIfv3PArPiZOEjO XQogErC9jn3WJ49rBvCu1B0uxVSURYs6tdoeADgMijFo/NqXMiPmF0yBlm6ID8VQhjCF r2WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f7Z8fYDp; 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 u46si28010415pgn.578.2019.07.29.12.34.54; Mon, 29 Jul 2019 12:35:09 -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=f7Z8fYDp; 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 S1729711AbfG2Tct (ORCPT + 99 others); Mon, 29 Jul 2019 15:32:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:46434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729378AbfG2Tcq (ORCPT ); Mon, 29 Jul 2019 15:32:46 -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 EEA9321773; Mon, 29 Jul 2019 19:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428765; bh=yil9+l6j76IKsza5SzZwEPu+xQ6omTD0jl61lKC4i5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7Z8fYDpqxskIK8UtUljP5fwmFdVENuuoIgqmhOyfDF6iq6DtBuAaAQ96OKbhgFge GPaEIseC8P3IwcJU1pauZru4Ut0cLqfQhY/y7sDQ24oeGfNKHxnDX8g1nvhH1f2uWj RM9MwXyVG8gV5JvC4J0utmxZsDiPnwyeVbZAU4oY= 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.14 178/293] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck() Date: Mon, 29 Jul 2019 21:21:09 +0200 Message-Id: <20190729190838.145729782@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 a704d032713b..f490d8d93ec3 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -185,23 +185,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