From patchwork Wed Nov 6 14:12:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178707 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp664795ilf; Wed, 6 Nov 2019 06:13:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwmhwvqn4xZSWIQ0rQS/56Pr8WtGn0QA6ngZEXPMl70e877bl18LOFZbF8AdplyOPo01Nhp X-Received: by 2002:aa7:df8c:: with SMTP id b12mr2982673edy.166.1573049607453; 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=eiOiGM8LrTMcVG6x8cHoPhd0+3gHd4IIXSnmQtJe0uOAjxRdXwEjlDjr/wfyDHBeqP ebTvc+2NDaZfP6T2dKWSJoFCp+UAIAT6YD1HE4LspLFgsaxISYma79cDlv1vWtH347nj HiWcYNMv9q1+SdLuJ+yF1cqAS+kFn/qPWgP6aIvFXP+2aJlmeuA4pZMaCjrEHPaSXsxC i5zMD6mD3nPVof53N4oybA41BJ9UB5y3BII+ko6nxY46667BCMOJWVPqIsNRGM4siJ4q 5GFdUYPgXaj2nEiDhyHw61ormPya/hbWcen1tXlksvk7MmyeMeHvQAEeI1/GTqwQ06ok iYPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=5J/Ofk6ylx2fNP9WdzIRZXeA0e3ywJAg5ijroGTIp5E=; b=yTq4YRvZU2RPqmTRn4mS325FPhMM0JY4ibxtaTYHQBKjsz0uYSeWuU/QaQSLHnArgD iXV8BG7b/tB69bT6uVbeYmzOy0EKUKnQ+6R6bH7p4awLhpxc3nSUzZZnB2bMZEYsqteP 4XItSpn2rrM109Lo5O9qJWqixOdvYwXwGInv8qg2BZUD01bwLT150ep/kvxtHHaY0Kyy q+Xl1QWe7FlHUl5EnbaTZMWL2wrpcg7HTW5qaEl20Kf6JJ7aLHgu5FZFKbDFpVpJjvWZ dZxrF4xvNDi5ZJgj16jBf2TxRD7K/0eq2z+boQ9j3UNpbrmlPMQveGjYFfst+gze4+eH jAow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tKY8u23a; 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=tKY8u23a; 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 S1726976AbfKFONY (ORCPT + 3 others); Wed, 6 Nov 2019 09:13:24 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54362 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727128AbfKFONY (ORCPT ); Wed, 6 Nov 2019 09:13:24 -0500 Received: by mail-wm1-f67.google.com with SMTP id z26so3588449wmi.4 for ; Wed, 06 Nov 2019 06:13:23 -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; bh=5J/Ofk6ylx2fNP9WdzIRZXeA0e3ywJAg5ijroGTIp5E=; b=tKY8u23aHs4/HPdanAkyFxDTfKUnmDGznwlyn9XjBCxK/OLl/98xLhDrlyXoAOfIaZ MTBKdzqlKcEi8Yg41n3F5ev4DIFFQCUugd5VfyB2HNWmoU4XikzTEDyANulDHbwvbcGt xDbwaS0xj8NvMvT+e/hpqaCLf8gOoFmdK/P02ME8aqM1f5ZIJy6RTYY9NhG5l3KDA+Wz PKOJOKmxd+5yxjo8fgNIlhqZK0EwwkMOR65hNLRR3VHbZAkOsiDGtqkOuLP1c2k9yL1F S4Ldyo5DpLfVAkoXEkLbUX6dB4/D40XNuTz48F2pAWJ0Ju6Z3ObFK2KYX4cDHUyK++vo VXrw== 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; bh=5J/Ofk6ylx2fNP9WdzIRZXeA0e3ywJAg5ijroGTIp5E=; b=N2G/4cwWqvanPOBeTKw5Jl2BRMXzlBHPk1a6WIgfZaMevz4rTLcv2pYNnq+YGIeeLn yxiOEoIpWiZH/HzW9h++XYT/DRpckNYv2e0Fm317rGON0oa2pngRfw+ARopeNoByjthm Q4wIFWcayyetVKCw0vxF6dN4vAZOyOEQ/aPvemYJ3LhU1po0WzgQMYt0mFLe2RQ/3qVh JNNPlRxxZhqZK/BSXEiHaPtlNMfcWAp19Ga/L65qeRVqx6fQl6V+U4fLmMWf6XIIAuos PtDUptRXUXP7ae9Ba947+fcDgZeXrhf8ZfZ7g20oCGN27iyHBH0/m7L9yWJ4cz/DpIH7 pEUA== X-Gm-Message-State: APjAAAXZufTasKUCBo0G1baerbdvVfeTNlCS2p/vyd5pgLSTt8GjfQwJ rSo+F2Tq8wP+GlK+ejIPvyn7JhFEjPJojA== X-Received: by 2002:a7b:c925:: with SMTP id h5mr2938042wml.115.1573049602083; Wed, 06 Nov 2019 06:13:22 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:13:21 -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 00/10] Improvements for random.h/archrandom.h Date: Wed, 6 Nov 2019 15:12:58 +0100 Message-Id: <20191106141308.30535-1-rth@twiddle.net> X-Mailer: git-send-email 2.17.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org During patch review for an addition of archrandom.h for arm64, it was suggeted that the arch_random_get_* functions should be marked __must_check. Which does sound like a good idea, since the by-reference integer output may be uninitialized when the boolean result is false. In addition, it turns out that arch_has_random() and arch_has_random_seed() are not used, and not easy to support for arm64. Rather than cobble something together that would not be testable, remove the interfaces against some future accidental use. In addition, I noticed a few other minor inconsistencies between the different architectures, e.g. powerpc isn't using bool. Change since v1: * Remove arch_has_random, arch_has_random_seed. r~ Richard Henderson (10): x86: Remove arch_has_random, arch_has_random_seed powerpc: Remove arch_has_random, arch_has_random_seed s390: Remove arch_has_random, arch_has_random_seed linux/random.h: Remove arch_has_random, arch_has_random_seed linux/random.h: Use false with bool linux/random.h: Mark CONFIG_ARCH_RANDOM functions __must_check x86: Mark archrandom.h functions __must_check powerpc: Use bool in archrandom.h powerpc: Mark archrandom.h functions __must_check s390x: Mark archrandom.h functions __must_check arch/powerpc/include/asm/archrandom.h | 27 +++++++++----------------- arch/s390/include/asm/archrandom.h | 20 ++++--------------- arch/x86/include/asm/archrandom.h | 28 ++++++++++++--------------- include/linux/random.h | 24 ++++++++--------------- 4 files changed, 33 insertions(+), 66 deletions(-) -- 2.17.1