Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6162484iog; Thu, 23 Jun 2022 12:39:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u3p7ConAfVG5uT2KtkJJ+6xDAePByKD1Y54/y3zMWDGHdMjH8q9rb3DF/a5mf3343NGxND X-Received: by 2002:a17:907:7f1d:b0:71d:ea75:e533 with SMTP id qf29-20020a1709077f1d00b0071dea75e533mr9979417ejc.78.1656013179877; Thu, 23 Jun 2022 12:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656013179; cv=none; d=google.com; s=arc-20160816; b=exgrvLeWU/uekg2cudZHXvIfo+gpOop4XAPQMrQHtec1RTLqbOFrZltg5bQC/i4aTj bXaRhsZHHgwdkYCXzCXB3PjNbZHdlTaHG9zkLrfArU6w60I1d5aJGJJJn/aoB14tFhBf gbl8ZbsJwXaRORaas8fFJ74GaokrqcWx15sosLFw/gKj79FL7P3nTk3NcsTE3k6oGLEy aWZOlljYMFMJeJq3i3rJ6D/EQ+TWm8n5faZ7RbXVk7gA5JUmLTeag2u81NJCtkCmG7Tm PtKgvx3dYCF36cqQV5a52npR+rxSZij4wiS2ivyyiwIO7hG0XBTnfndJcsQupwM6F3a5 SROQ== 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=sNbXz2He74SfSQBf6aYy1TPgk5j6jmn+vtcAoDs8Xwg=; b=zUMI4YH/tkVGFRoB4QSVOXc5c9hG6kI12I671r9Uow8RvVy+PjK/Rb4389BbpulPUk umvlbVn/AgDBIbvMhi1fwX/zCGAwzqaz5LuBmhXsvAWmcv5p4NxdXel5EBfVRRgKWojK 495Y6KGfHrSfSkm28T6ruVuNfBiwmlrrO0YrQY2P8TyOULdIjazldKLIt/kjNEbOxWLA FfqdD0mBNxx4YMXCQFmSjsuseNYYz8Tv7KIidnDlcIQR0KO9BuOmmHvcLWiDoCMk2NbT WK65QBwqs5m5yhn1B9jSqkFUk44gxabWUh5mSOQsNhQEbMtcXSeIF+XdTPoPTf2f18CV MdJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vGYw7ieP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a056402519100b004356a07ed0dsi649548edd.286.2022.06.23.12.39.14; Thu, 23 Jun 2022 12:39:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vGYw7ieP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231980AbiFWR4o (ORCPT + 99 others); Thu, 23 Jun 2022 13:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235874AbiFWRxd (ORCPT ); Thu, 23 Jun 2022 13:53:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFAB19E725; Thu, 23 Jun 2022 10:14:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D65C4B82489; Thu, 23 Jun 2022 17:14:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1474FC341C4; Thu, 23 Jun 2022 17:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004451; bh=sXL19wqCbyr+cbKWaI19FppbVCfkIQcc2wyE5ao7Vyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vGYw7iePcrpyXX4arqRpnMD4WBnVFpMPLQd+fl9iJqKqgniQPMv5VrVzqC0Nsn9j0 Qr7NpTSccDfud4WNbOGHzsf/lSCaXDM4JzswSHfeCCELNMOEXZCttVsQOMyCY5Tvhy LOVywUSP/DyU/q7M/XDgM1RanpXWBDRqPos0wqRs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Richard Henderson , Mark Brown , Theodore Tso , "Jason A. Donenfeld" Subject: [PATCH 4.19 035/234] x86: Remove arch_has_random, arch_has_random_seed Date: Thu, 23 Jun 2022 18:41:42 +0200 Message-Id: <20220623164344.058973220@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Henderson commit 5f2ed7f5b99b54389b74e53309677831ac9cb9d7 upstream. Use the expansion of these macros directly in arch_get_random_*. These symbols are currently part of the generic archrandom.h interface, but are currently unused and can be removed. Signed-off-by: Richard Henderson Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20200110145422.49141-2-broonie@kernel.org Signed-off-by: Theodore Ts'o Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/archrandom.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) --- a/arch/x86/include/asm/archrandom.h +++ b/arch/x86/include/asm/archrandom.h @@ -86,10 +86,6 @@ static inline bool rdseed_int(unsigned i return ok; } -/* Conditional execution based on CPU type */ -#define arch_has_random() static_cpu_has(X86_FEATURE_RDRAND) -#define arch_has_random_seed() static_cpu_has(X86_FEATURE_RDSEED) - /* * These are the generic interfaces; they must not be declared if the * stubs in are to be invoked, @@ -99,22 +95,22 @@ static inline bool rdseed_int(unsigned i static inline bool arch_get_random_long(unsigned long *v) { - return arch_has_random() ? rdrand_long(v) : false; + return static_cpu_has(X86_FEATURE_RDRAND) ? rdrand_long(v) : false; } static inline bool arch_get_random_int(unsigned int *v) { - return arch_has_random() ? rdrand_int(v) : false; + return static_cpu_has(X86_FEATURE_RDRAND) ? rdrand_int(v) : false; } static inline bool arch_get_random_seed_long(unsigned long *v) { - return arch_has_random_seed() ? rdseed_long(v) : false; + return static_cpu_has(X86_FEATURE_RDSEED) ? rdseed_long(v) : false; } static inline bool arch_get_random_seed_int(unsigned int *v) { - return arch_has_random_seed() ? rdseed_int(v) : false; + return static_cpu_has(X86_FEATURE_RDSEED) ? rdseed_int(v) : false; } extern void x86_init_rdrand(struct cpuinfo_x86 *c);