From patchwork Fri Jan 10 14:54:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 198253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45EFBC33CA3 for ; Fri, 10 Jan 2020 14:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 132322084D for ; Fri, 10 Jan 2020 14:54:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578668074; bh=/jsajZNOWeSDY/g9QWa169FaWCLDFCqOyxId+l59GWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ISsag30YW/CTLvck4fludhSQNv2ZVJGaCwHrz6hREV492jYAdtop9axgyedjAdIOS 8XVl1o87xGSxvvmCBkB7QS2KPPZ6qsTa5P74H5B1RrejKTRMIiGEfk8U8mCG4NAUgg 3snAfiM3bVWU8QOmUC9C5xQj1a1tS0ZMOvHSyhVs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728270AbgAJOyd (ORCPT ); Fri, 10 Jan 2020 09:54:33 -0500 Received: from foss.arm.com ([217.140.110.172]:45806 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728137AbgAJOyc (ORCPT ); Fri, 10 Jan 2020 09:54:32 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02DCD1063; Fri, 10 Jan 2020 06:54:32 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 81E6F3F6C4; Fri, 10 Jan 2020 06:54:31 -0800 (PST) From: Mark Brown To: linux-arch@vger.kernel.org Cc: Richard Henderson , Borislav Petkov , linux-s390@vger.kernel.org, herbert@gondor.apana.org.au, x86@kernel.org, linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Richard Henderson , Mark Brown Subject: [PATCH v2 02/10] powerpc: Remove arch_has_random, arch_has_random_seed Date: Fri, 10 Jan 2020 14:54:14 +0000 Message-Id: <20200110145422.49141-3-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200110145422.49141-1-broonie@kernel.org> References: <20200110145422.49141-1-broonie@kernel.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Richard Henderson 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 --- arch/powerpc/include/asm/archrandom.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h index a09595f00cab..2fa7cdfbba24 100644 --- a/arch/powerpc/include/asm/archrandom.h +++ b/arch/powerpc/include/asm/archrandom.h @@ -34,16 +34,6 @@ static inline int arch_get_random_seed_int(unsigned int *v) return rc; } - -static inline int arch_has_random(void) -{ - return 0; -} - -static inline int arch_has_random_seed(void) -{ - return !!ppc_md.get_random_seed; -} #endif /* CONFIG_ARCH_RANDOM */ #ifdef CONFIG_PPC_POWERNV From patchwork Fri Jan 10 14:54:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 198252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C027BC282DD for ; Fri, 10 Jan 2020 14:54:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E7302072E for ; Fri, 10 Jan 2020 14:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578668077; bh=ViOktEQfPeyL9ULZ7ZNFDRBnZeCYxoWxar371Wbv7Rw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zyUwFjVzDwNMyADfLO1UHpEbz28CygpVqnMOEctMUzcfYyVfPNGuzpwCnXT83dDIP M+vt8VaVKdW1AmrUBSCYhOmOpJTasqvM3CgJN2E7g9kgL3oTyRBijTQC67ns+a+D3l HzCn1TBTi2I/Bz/OksWH2gdsBm+eMDOjQC4hD1Ro= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728290AbgAJOyg (ORCPT ); Fri, 10 Jan 2020 09:54:36 -0500 Received: from foss.arm.com ([217.140.110.172]:45844 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728239AbgAJOyg (ORCPT ); Fri, 10 Jan 2020 09:54:36 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 36B5930E; Fri, 10 Jan 2020 06:54:36 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B58393F6C4; Fri, 10 Jan 2020 06:54:35 -0800 (PST) From: Mark Brown To: linux-arch@vger.kernel.org Cc: Richard Henderson , Borislav Petkov , linux-s390@vger.kernel.org, herbert@gondor.apana.org.au, x86@kernel.org, linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Richard Henderson , Mark Brown Subject: [PATCH v2 04/10] linux/random.h: Remove arch_has_random, arch_has_random_seed Date: Fri, 10 Jan 2020 14:54:16 +0000 Message-Id: <20200110145422.49141-5-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200110145422.49141-1-broonie@kernel.org> References: <20200110145422.49141-1-broonie@kernel.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Richard Henderson The arm64 version of archrandom.h will need to be able to test for support and read the random number without preemption, so a separate query predicate is not practical. Since this part of the generic interface is unused, remove it. Signed-off-by: Richard Henderson Signed-off-by: Mark Brown --- include/linux/random.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/linux/random.h b/include/linux/random.h index f189c927fdea..7fd0360908d2 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -175,10 +175,6 @@ static inline bool arch_get_random_int(unsigned int *v) { return 0; } -static inline bool arch_has_random(void) -{ - return 0; -} static inline bool arch_get_random_seed_long(unsigned long *v) { return 0; @@ -187,10 +183,6 @@ static inline bool arch_get_random_seed_int(unsigned int *v) { return 0; } -static inline bool arch_has_random_seed(void) -{ - return 0; -} #endif /* Pseudo random number generator from numerical recipes. */ From patchwork Fri Jan 10 14:54:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 198249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4C3AC47409 for ; Fri, 10 Jan 2020 14:54:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7181020842 for ; Fri, 10 Jan 2020 14:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578668096; bh=yE3X7yiSJVPul5S39YxaKBL1oHAWWRlJFIqiGlCzp1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=128BVP8/t9pCZBlSJtYQNOUOg8LIX2ukPzVcoRt5c3DSotIuc//tSyEjM9BX9mr7S s51/ZB5ABB4gM8qOA30U1hxBZPOeRUVBNq/+VBO38c4d+qQyNVs0bgdKyGTF1yHW/5 t3FJpbaR0rgoaZLW3zlJh8fW8PZtxG2daVzWm9vs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728331AbgAJOyj (ORCPT ); Fri, 10 Jan 2020 09:54:39 -0500 Received: from foss.arm.com ([217.140.110.172]:45862 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbgAJOyi (ORCPT ); Fri, 10 Jan 2020 09:54:38 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 506BD11B3; Fri, 10 Jan 2020 06:54:38 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0A1B3F6C4; Fri, 10 Jan 2020 06:54:37 -0800 (PST) From: Mark Brown To: linux-arch@vger.kernel.org Cc: Richard Henderson , Borislav Petkov , linux-s390@vger.kernel.org, herbert@gondor.apana.org.au, x86@kernel.org, linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Richard Henderson , Mark Brown Subject: [PATCH v2 05/10] linux/random.h: Use false with bool Date: Fri, 10 Jan 2020 14:54:17 +0000 Message-Id: <20200110145422.49141-6-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200110145422.49141-1-broonie@kernel.org> References: <20200110145422.49141-1-broonie@kernel.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Richard Henderson Keep the generic fallback versions in sync with the other architecture specific implementations and use the proper name for false. Suggested-by: Ard Biesheuvel Signed-off-by: Richard Henderson Signed-off-by: Mark Brown --- include/linux/random.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/random.h b/include/linux/random.h index 7fd0360908d2..ea0e2f5f1ec5 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -169,19 +169,19 @@ static inline void prandom_seed_state(struct rnd_state *state, u64 seed) #else static inline bool arch_get_random_long(unsigned long *v) { - return 0; + return false; } static inline bool arch_get_random_int(unsigned int *v) { - return 0; + return false; } static inline bool arch_get_random_seed_long(unsigned long *v) { - return 0; + return false; } static inline bool arch_get_random_seed_int(unsigned int *v) { - return 0; + return false; } #endif From patchwork Fri Jan 10 14:54:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 198251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F47EC33CA4 for ; Fri, 10 Jan 2020 14:54:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06CB12080D for ; Fri, 10 Jan 2020 14:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578668086; bh=aMwJZ686WU+COYac3SkKSQr+JAT9g3lOGRCy09JPsSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KJVDhY9ZmrSdjMPNSG+8fOXM8mTqahfn9nSP1Cg4GTqCnSbrL1lu8L7ltykLeZLm6 TAYonUdCJAYDHncOV3BZKxsbWy7Ff6Cz8yZILqtDBku0KKMvVwH6PBYp2MxSjoQtRi USpIBFxUcgImXaWmFAnZzsfEQebcKuNc7wPNk7Lw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728378AbgAJOyp (ORCPT ); Fri, 10 Jan 2020 09:54:45 -0500 Received: from foss.arm.com ([217.140.110.172]:45914 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728374AbgAJOyn (ORCPT ); Fri, 10 Jan 2020 09:54:43 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EAF47DA7; Fri, 10 Jan 2020 06:54:42 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 762A83F6C4; Fri, 10 Jan 2020 06:54:42 -0800 (PST) From: Mark Brown To: linux-arch@vger.kernel.org Cc: Richard Henderson , Borislav Petkov , linux-s390@vger.kernel.org, herbert@gondor.apana.org.au, x86@kernel.org, linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Richard Henderson , Mark Brown Subject: [PATCH v2 07/10] x86: Mark archrandom.h functions __must_check Date: Fri, 10 Jan 2020 14:54:19 +0000 Message-Id: <20200110145422.49141-8-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200110145422.49141-1-broonie@kernel.org> References: <20200110145422.49141-1-broonie@kernel.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Richard Henderson We must not use the pointer output without validating the success of the random read. Reviewed-by: Ard Biesheuvel Signed-off-by: Richard Henderson Signed-off-by: Mark Brown --- arch/x86/include/asm/archrandom.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/archrandom.h b/arch/x86/include/asm/archrandom.h index feb59461046c..7a4bb1bd4bdb 100644 --- a/arch/x86/include/asm/archrandom.h +++ b/arch/x86/include/asm/archrandom.h @@ -27,7 +27,7 @@ /* Unconditional execution of RDRAND and RDSEED */ -static inline bool rdrand_long(unsigned long *v) +static inline bool __must_check rdrand_long(unsigned long *v) { bool ok; unsigned int retry = RDRAND_RETRY_LOOPS; @@ -41,7 +41,7 @@ static inline bool rdrand_long(unsigned long *v) return false; } -static inline bool rdrand_int(unsigned int *v) +static inline bool __must_check rdrand_int(unsigned int *v) { bool ok; unsigned int retry = RDRAND_RETRY_LOOPS; @@ -55,7 +55,7 @@ static inline bool rdrand_int(unsigned int *v) return false; } -static inline bool rdseed_long(unsigned long *v) +static inline bool __must_check rdseed_long(unsigned long *v) { bool ok; asm volatile(RDSEED_LONG @@ -64,7 +64,7 @@ static inline bool rdseed_long(unsigned long *v) return ok; } -static inline bool rdseed_int(unsigned int *v) +static inline bool __must_check rdseed_int(unsigned int *v) { bool ok; asm volatile(RDSEED_INT @@ -80,22 +80,22 @@ static inline bool rdseed_int(unsigned int *v) */ #ifdef CONFIG_ARCH_RANDOM -static inline bool arch_get_random_long(unsigned long *v) +static inline bool __must_check arch_get_random_long(unsigned long *v) { return static_cpu_has(X86_FEATURE_RDRAND) ? rdrand_long(v) : false; } -static inline bool arch_get_random_int(unsigned int *v) +static inline bool __must_check arch_get_random_int(unsigned int *v) { return static_cpu_has(X86_FEATURE_RDRAND) ? rdrand_int(v) : false; } -static inline bool arch_get_random_seed_long(unsigned long *v) +static inline bool __must_check arch_get_random_seed_long(unsigned long *v) { return static_cpu_has(X86_FEATURE_RDSEED) ? rdseed_long(v) : false; } -static inline bool arch_get_random_seed_int(unsigned int *v) +static inline bool __must_check arch_get_random_seed_int(unsigned int *v) { return static_cpu_has(X86_FEATURE_RDSEED) ? rdseed_int(v) : false; } From patchwork Fri Jan 10 14:54:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 198250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8A30C33CA3 for ; Fri, 10 Jan 2020 14:54:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B05BD20721 for ; Fri, 10 Jan 2020 14:54:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578668092; bh=3fZXe01M1DES1nCJzaQ2syzPGlGt6/Fcr4JJpAfV2kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BggAk8yX+x9ytgJp2xEPmzi0CqmCtG2WlKUyiQxgqYQ28Z5UMIm8dTKghf8/Y+Uqn wHG1/UMQrV1nNRjXytYT3Qt1EWhILN6hGnLf74kbjNZ1LeySymDe07okMQs+cX1JAH iASCivP+vM7++sF9tyg9RM+iglRtMNZGot94tv/s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728384AbgAJOyu (ORCPT ); Fri, 10 Jan 2020 09:54:50 -0500 Received: from foss.arm.com ([217.140.110.172]:45932 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728370AbgAJOyp (ORCPT ); Fri, 10 Jan 2020 09:54:45 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0FA23142F; Fri, 10 Jan 2020 06:54:45 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8D1A53F6C4; Fri, 10 Jan 2020 06:54:44 -0800 (PST) From: Mark Brown To: linux-arch@vger.kernel.org Cc: Richard Henderson , Borislav Petkov , linux-s390@vger.kernel.org, herbert@gondor.apana.org.au, x86@kernel.org, linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Richard Henderson , Mark Brown Subject: [PATCH v2 08/10] powerpc: Use bool in archrandom.h Date: Fri, 10 Jan 2020 14:54:20 +0000 Message-Id: <20200110145422.49141-9-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200110145422.49141-1-broonie@kernel.org> References: <20200110145422.49141-1-broonie@kernel.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Richard Henderson The generic interface uses bool not int; match that. Reviewed-by: Ard Biesheuvel Signed-off-by: Richard Henderson Signed-off-by: Mark Brown --- arch/powerpc/include/asm/archrandom.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h index 2fa7cdfbba24..f0f16b4fc5ea 100644 --- a/arch/powerpc/include/asm/archrandom.h +++ b/arch/powerpc/include/asm/archrandom.h @@ -6,27 +6,28 @@ #include -static inline int arch_get_random_long(unsigned long *v) +static inline bool arch_get_random_long(unsigned long *v) { - return 0; + return false; } -static inline int arch_get_random_int(unsigned int *v) +static inline bool arch_get_random_int(unsigned int *v) { - return 0; + return false; } -static inline int arch_get_random_seed_long(unsigned long *v) +static inline bool arch_get_random_seed_long(unsigned long *v) { if (ppc_md.get_random_seed) return ppc_md.get_random_seed(v); - return 0; + return false; } -static inline int arch_get_random_seed_int(unsigned int *v) + +static inline bool arch_get_random_seed_int(unsigned int *v) { unsigned long val; - int rc; + bool rc; rc = arch_get_random_seed_long(&val); if (rc)