From patchwork Wed Nov 6 14:12:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178708 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp664804ilf; Wed, 6 Nov 2019 06:13:27 -0800 (PST) X-Google-Smtp-Source: APXvYqyLrRBMKK0vJJvth1FMCrddztaMjiVNiYQ6oyrJasUpOueoHlKaprB2/iKM7sPZRRz1jtpa X-Received: by 2002:a17:906:70d2:: with SMTP id g18mr35838926ejk.18.1573049607801; Wed, 06 Nov 2019 06:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573049607; cv=none; d=google.com; s=arc-20160816; b=vYZf1dF2io4pe9sg3H2/k6nXJBUoKsKVImHEyK1hbAfkmdVZQn1sw3jrv1moyczSn5 WDb+114Bnej3qsaPsuxtXq8LCwzr2kb2tpUxpbljfyu1riAbOBjByAh3zyf+NvKiEVgv B41u51bgSFRraAWHw4FgYjsUKtIO4C8ZSbe1MKDu/DuriJeHO/i0z32sGhoxa5CGzbbX LopSUaf3ePvAspfS3R04PpyTqS25TersOT0MpZR0rXai0m+XN4aUsFv80QxBtAyhmJU2 ecMLBIX3mMgJGvQFR1nBipjgy8oypKSMWYI9oEcQj4c/733MpSN+krgjuodaw7LePEI8 zvdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=leR1246hJ3phHrVVcpyVvX9EN15YsfZYkjubgOlomC8=; b=dVeshQ7+3iW04TQz0AY7fcYIBSs3rK2CPTaX6XfxsKDJrYSbd8AA6vEIFz5swQeCJr p5CS6X6M6GC7Tnxx5FEmeaq99iutJdN1qgT0HXaOTePCR3fi5DODqTl/mQqFTy5VmCrx SvMZOPL2aPLhUfLbRF9f8b09q4i46leFEp5nnwHgnn4Ba69n0ovidhubUnDdJjfrBHwE QhJR+g14TU+fRNGlTT0i7lZA0XzaJ/o1othcrvNk1Db2oI+n3sza19z4Fu/SFhXbHp5e 2KDzLkeSYze5aVhOS8lXZ0TxxHbvlFJTvT3EYHlepeDJbhWJAAJdA/l01TMZ3/IjzChj 65Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=huUR3QVI; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si15189348ejp.287.2019.11.06.06.13.27; Wed, 06 Nov 2019 06:13:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@linaro.org header.s=google header.b=huUR3QVI; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727324AbfKFON0 (ORCPT + 3 others); Wed, 6 Nov 2019 09:13:26 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45016 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727616AbfKFON0 (ORCPT ); Wed, 6 Nov 2019 09:13:26 -0500 Received: by mail-wr1-f66.google.com with SMTP id f2so17072998wrs.11 for ; Wed, 06 Nov 2019 06:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=leR1246hJ3phHrVVcpyVvX9EN15YsfZYkjubgOlomC8=; b=huUR3QVIlM/iMH0usGmIB9OiEcCLZqXcp97YwEo5S55jvpui/qZdGTCJbFI62dX4/j 2W64NWcBKbPpYtkVVdo/cO1Jt92q8rAf5ACvD4PU71NfcDy1YwoV8btWGC4x7jK7xBZH 4pgY90Y5biZu7ryNMqgndRgyVybVzvi6p61/yXwqnS60DGsgWKw/oS56vnc+2wljX/IS jjo7CDxwHqosEN+WVtvNt9GxrZEEeNlAO6la4IXeWWkEZQG8RuRmPzPChqiiwmD03fka KBkfelHAHCWA/mSrfKOHrqlItLLBFxLHUluhYQUZBpOvPwIkowMuH0Ftl02VvxcVd/Z3 ixaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=leR1246hJ3phHrVVcpyVvX9EN15YsfZYkjubgOlomC8=; b=KQizo1xGjlI4roHrPdf2LTgnCUTNT4S5HyYsC7gEEsLjnaZAqlV1+nTxJm0BKxY3uk PzPh9xbyt7moCrrGWTNxdYksEqShWG7/jiGpYAN8zSCr6+sS02mwiOSnSeyJ/g37BirI PFMNfS3Vmi4XZ9CtZpQ0Bl3T02u2qPhZ684SMLWgns56QcHrpu6GxhrjRcEd0lsTcBA7 CPW2DNka2m85GdsdqQlBX6fYbjU3rhS5yNwqtgCpMs1mN2Gw6P2j/g0pkRYDBL2eBp5X NsxJNdLcJRa1ZgQ43mD4VIKiB7iDhjJlJG5W119sURraeh4nHCK9yPbNqn3wEzUOUaVg IF9w== X-Gm-Message-State: APjAAAUmcXESgtOU0XP8kutlzHuJ4UjhM7Ni8F79ojOf1tUUqVPIxzz3 sIgkaCk68XxrOU9Wy6An/jR0G1Yxb/IXwQ== X-Received: by 2002:a5d:4649:: with SMTP id j9mr2973687wrs.248.1573049604042; Wed, 06 Nov 2019 06:13:24 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id b3sm2837556wma.13.2019.11.06.06.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:23 -0800 (PST) From: Richard Henderson X-Google-Original-From: Richard Henderson To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, linux-arch@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 01/10] x86: Remove arch_has_random, arch_has_random_seed Date: Wed, 6 Nov 2019 15:12:59 +0100 Message-Id: <20191106141308.30535-2-rth@twiddle.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106141308.30535-1-rth@twiddle.net> References: <20191106141308.30535-1-rth@twiddle.net> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- arch/x86/include/asm/archrandom.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/arch/x86/include/asm/archrandom.h b/arch/x86/include/asm/archrandom.h index af45e1452f09..feb59461046c 100644 --- a/arch/x86/include/asm/archrandom.h +++ b/arch/x86/include/asm/archrandom.h @@ -73,10 +73,6 @@ static inline bool rdseed_int(unsigned int *v) 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 int *v) 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);