Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2931198iog; Mon, 20 Jun 2022 07:44:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uuD05qdmyUfgqqtmpAMSVQu86u6KgCEfGEhgUxSdHj7CsoBJgiwItcMHDJioMzBT95bMV7 X-Received: by 2002:a63:be41:0:b0:40c:b4a8:dee9 with SMTP id g1-20020a63be41000000b0040cb4a8dee9mr5595164pgo.107.1655736258812; Mon, 20 Jun 2022 07:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736258; cv=none; d=google.com; s=arc-20160816; b=0oVSrat/8X6R2tfyXuC15x1yIMpDf95xcX8q456M6ZiR8pd0le5gKwOuyTLG1KQ633 vbO+bREGLNFLd5l/f9mQ4GNS3AnY8bRyJ5TKLl2BiJmV0K8Z4VAKLlZKetZzHcDwvmbo J+LvQSsNFt9YqYSC953ZoGeHVANgmszm+lt1v9EmFOfiyQUf/trQ1O+GKrzQAdaDCWOs 6boOPKRiMkZfzimZMj3KBBg7NMXCX2EITctysYYBfpeN8TyX/PlBx589/LgA0FV53sKN bVSAjhOXWA60KUR2CS/d+EpOPfTfKAQHYf3+j2Pa+/mM4mP3f54laCL9/DJ/6aiZbKKA erTg== 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=rjZ3v+0n71Mc+QVqrNQeSDFYYp2NzAiPpx3H/NLWGwQ=; b=wf0mCj0cqAitmIQ2Xi+lVyF+Ez/bOffhLR54IMC6KXB7wniu1OB5DchF5y2l1ABLI3 yqNA3Qm5SzQk8Uzd7oCpA1djpMJkLtNjuw6V/jG21gXo14/rqiwAOafVklKgiWEErJVl f88ieGKjuNwpIvZjMuLN+cu+8yGLodXvJjiVzhw7PPf8PQ7u62RgeqJOza5wWSxvuExZ swTWqC/cumXDOqJ4qC1msTQm/kDYxr6DL5zkBl69U37Dr4Rm03AceG9fP7EfzkfiWZQp ylcJcHt18a/952SL9EzqmyUHC/iJG3ryFseRAE3EBPu4wbmL0Wd4mbnDdGUHfib/053i Sxjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rpOTWEfY; 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 n11-20020a634d4b000000b003fd55608dccsi14049048pgl.192.2022.06.20.07.44.06; Mon, 20 Jun 2022 07:44:18 -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=rpOTWEfY; 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 S1346833AbiFTNh1 (ORCPT + 99 others); Mon, 20 Jun 2022 09:37:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346820AbiFTNgq (ORCPT ); Mon, 20 Jun 2022 09:36:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A948D1EC62; Mon, 20 Jun 2022 06:13:55 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B1DA560A21; Mon, 20 Jun 2022 13:13:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABBC0C3411B; Mon, 20 Jun 2022 13:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655730805; bh=TRcz5Uue/htCzSQMkJioTO3AotFiNV/xnRz21HLEc5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rpOTWEfY+wTS8lQfCtUTKIx3030qo4cSkcmsE9V6BJCshoA5N6B5uz925iQSlSzAB 8usC/f4kPznjXete3I5NQqTcmpbeevwVAzvIDb93aHpi4fwvGznGym7hzq1VFLhho2 CwlP3FEjhbGJaCOJnCFvMVdFnRcD8VK/gDXPDWZM= 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 5.4 024/240] x86: Remove arch_has_random, arch_has_random_seed Date: Mon, 20 Jun 2022 14:48:45 +0200 Message-Id: <20220620124738.512541086@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@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 @@ -73,10 +73,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, @@ -86,22 +82,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);