Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6046501iog; Thu, 23 Jun 2022 10:12:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sXlx9mfK0bQBCN76Egg7qlVXC7vPnhVHK4MQ5iVQKvBln6UrA+d2L4kGTK0C+w7wxs6POo X-Received: by 2002:aa7:c14f:0:b0:435:7b75:fd06 with SMTP id r15-20020aa7c14f000000b004357b75fd06mr12068251edp.352.1656004323866; Thu, 23 Jun 2022 10:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656004323; cv=none; d=google.com; s=arc-20160816; b=KLiWJZf3Zv/ZnHeVA965S63XnaZyME/ifZxhOE453XWNCq/dKH4HIkovyT85Snz4DN LXm4/fiCwidTlWfC2QQU2tMiD1YVE6JLVp6CFt4kytF68lPQ/NTnL7vMI2ae4c/f98Wq PaClnw21ymCQ3h3jyrQ0UZf3ph8vrAD5DlH3wybrePTKKtem/gGg969TW3ukrHyVoP+p DNW+2lJCriAUQSDLR9fkBrTRcThTtXjVhIjSj+RxkGEmjzCNesXhL3i+mpUszVJD9vY6 AknE2hN249IqXhZiKtOc3yrxADlW01vXUnN5clQ3TOyOfOzLxuPAosmb3fn0ZBd/EL67 JAnA== 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=KHjo2f/+rfWr7GtPF9QGlBlfD6IjhgEgCoP18JtC8oD6mvgQitnjiNNU33AwBaSogj Ayo6jY2zDWSSkFxFZIq4hXhfJQ17hf++fyCJvKYKEksJrgu6fugxFBmyM4NaBZsBMJAD cQdxzxLpQYY/Ed2M4AXD7IEL6Uv/EeC0A56sNkOB+OL3+8HMDSzl4mzLBSRr6s9nThnp Y+MoKnmhsjGnBawf5ov3lmSTssVY8Ggu7/iIWZ5cuVm9OA02pYu3BwQisJac5alhYpPT X11qogpoGVUPQ71wjSCtELclq7YiKR4GHwNBmNMJgGMUPA/PuEhfPy6/N1BDhUvVex62 FDMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AjMw9MBn; 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 y12-20020a056402358c00b0042bd2c39f07si87150edc.596.2022.06.23.10.11.38; Thu, 23 Jun 2022 10:12:03 -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=AjMw9MBn; 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 S232374AbiFWQ6n (ORCPT + 99 others); Thu, 23 Jun 2022 12:58:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233367AbiFWQut (ORCPT ); Thu, 23 Jun 2022 12:50:49 -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 06A5B4F1ED; Thu, 23 Jun 2022 09:48:43 -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 8D8C161FB8; Thu, 23 Jun 2022 16:48:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66840C3411B; Thu, 23 Jun 2022 16:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656002921; bh=sXL19wqCbyr+cbKWaI19FppbVCfkIQcc2wyE5ao7Vyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AjMw9MBnRARioDErIYx3zNksb8nk9ht99kCkEE2GYK+MkPEdDxFVFdkr8sfQ8nUZK a9o0CKNgF/EsiUA8/f1oFJ04QZWAR+1SadoUnhg41YnpkGmJirgIV92CZn9Z9yg0uc NV1sBx2dhBzEOgAePI+xxoMKMtnnvS8+8tJeit9o= 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.9 069/264] x86: Remove arch_has_random, arch_has_random_seed Date: Thu, 23 Jun 2022 18:41:02 +0200 Message-Id: <20220623164346.023739431@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@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);