Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp626560pxx; Wed, 28 Oct 2020 12:45:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy39sWz/RiFVXtDqsKcksLvkUaVsjtZBGwGOUJfHKsX0ywDb4+lS6KGeoG/i4JgKTotXY7r X-Received: by 2002:a17:906:aed9:: with SMTP id me25mr747189ejb.52.1603914329459; Wed, 28 Oct 2020 12:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603914329; cv=none; d=google.com; s=arc-20160816; b=Ytdp0CSDeDQ01CSswlIU82sb5ryi8P+OgvhUlHS5fGDSqXwRA3Qu734+0PdqBbYYS3 HvksltQDjbi2RhvB/N6F02ooukBbdETP1Tc1sHaffiwT5O8hV0e19CigNkFsxj7067p1 KoKBTpvqzf+umDN3GeadBXfUqpODIACDyE6JOoXwk5MyveNRJGhQQnTEMqBqgFffGYdJ IQItNqR5L6t8mb1WGc8QUE3sXPg1dQf9ZLn4spRIvbn8U4EOfdBgWaeSgpSDWmTCKRM9 F0rVZI/B92PxWkIupSujxowPXcvllbnJV2kWuNDYAOJLzabE5XRV12RCYYZ3grlhkmMK CPDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Rv+tlh8Img8NAij8LN5BEvc3f0MM+MthIqbQ6vJjDXI=; b=uXHUSyXgwPy0fP/LX09QpEu9PPvpD5DqJIg49/4S+V+h3u40vRj5Bwaon489Yu0/N/ TuRheSnYFZ3AvAvrWXcNj9DSUPhGCOElZgOGRqNLIGEsw8FzTge/OCFgbv4U5yG7XIh/ xq5KaU0KWcP72baRdS7zcnjThtVIL3xgoRgAxzd3WvXqJqxUcvBPa0H6ANiTSg2kPR5V W01xrWGd3i+spGVV1B/4uJj9ndMQn86ZpkRVqiLZUhSTbvWZ1xPkrJBs5OKI7w7Uax8r aq0sZA7HDw3b4wD7DJ4T9R+wKc/rTLwuGn1SWLq1g0eNBN2H9yykSK6wyC1GQETwkece GGYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QdWHlUXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si9672edr.422.2020.10.28.12.44.59; Wed, 28 Oct 2020 12:45:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QdWHlUXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1827759AbgJ0S1p (ORCPT + 99 others); Tue, 27 Oct 2020 14:27:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:44884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752943AbgJ0N5s (ORCPT ); Tue, 27 Oct 2020 09:57:48 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 CC0E9206D4; Tue, 27 Oct 2020 13:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807067; bh=ZnPENhl4i9EH0nQMbyJDFa000wmUTCb8y8kmOoKdyNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QdWHlUXBF92vX3HkF9m1YntT0F8abHxT7niVJQMfihEKttwldqhTvwPZ1pJeKLdZV t9LD030kqXa9o17bSWeUVuHVlNcjw1ivmTAJGCDXCwFp/Kwspj0LoUv1WrjcwcHVbv VjDxRvCqQt7vlSJ4YOwdOJlO0oqqKFZDmhsIDI80= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Ryabinin , Linus Torvalds , Ben Hutchings Subject: [PATCH 4.4 008/112] compiler.h, kasan: Avoid duplicating __read_once_size_nocheck() Date: Tue, 27 Oct 2020 14:48:38 +0100 Message-Id: <20201027134900.942338117@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Ryabinin commit bdb5ac801af3d81d36732c2f640d6a1d3df83826 upstream. 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: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- include/linux/compiler.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -241,23 +241,21 @@ void __read_once_size(const volatile voi #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) {