From: Michael Ellerman <mpe@ellerman.id.au>
To: Richard Henderson <richard.henderson@linaro.org>,
linux-arch@vger.kernel.org
Cc: x86@kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 5/6] powerpc: Mark archrandom.h functions __must_check
Date: Wed, 30 Oct 2019 22:37:01 +1100 [thread overview]
Message-ID: <87v9s6bh2a.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20191028210559.8289-6-rth@twiddle.net>
Richard Henderson <richard.henderson@linaro.org> writes:
> We cannot use the pointer output without validating the
> success of the random read.
You _can_, but you must not. </pedant>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/include/asm/archrandom.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
cheers
> diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h
> index f8a887c8b7f8..ee214b153a71 100644
> --- a/arch/powerpc/include/asm/archrandom.h
> +++ b/arch/powerpc/include/asm/archrandom.h
> @@ -6,17 +6,17 @@
>
> #include <asm/machdep.h>
>
> -static inline bool arch_get_random_long(unsigned long *v)
> +static inline bool __must_check arch_get_random_long(unsigned long *v)
> {
> return false;
> }
>
> -static inline bool arch_get_random_int(unsigned int *v)
> +static inline bool __must_check arch_get_random_int(unsigned int *v)
> {
> return 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)
> {
> if (ppc_md.get_random_seed)
> return ppc_md.get_random_seed(v);
> @@ -24,7 +24,7 @@ static inline bool arch_get_random_seed_long(unsigned long *v)
> return 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)
> {
> unsigned long val;
> bool rc;
> --
> 2.17.1
next prev parent reply other threads:[~2019-10-30 11:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 21:05 [PATCH 0/6] Improvements for random.h/archrandom.h Richard Henderson
2019-10-28 21:05 ` [PATCH 1/6] random: Mark CONFIG_ARCH_RANDOM functions __must_check Richard Henderson
2019-10-29 8:21 ` Ard Biesheuvel
2019-10-28 21:05 ` [PATCH 2/6] x86: Move arch_has_random* inside CONFIG_ARCH_RANDOM Richard Henderson
2019-10-28 21:05 ` [PATCH 3/6] x86: Mark archrandom.h functions __must_check Richard Henderson
2019-10-28 21:05 ` [PATCH 4/6] powerpc: Use bool in archrandom.h Richard Henderson
2019-10-28 21:05 ` [PATCH 5/6] powerpc: Mark archrandom.h functions __must_check Richard Henderson
2019-10-30 11:37 ` Michael Ellerman [this message]
2019-10-28 21:05 ` [PATCH 6/6] s390x: " Richard Henderson
2019-10-29 7:26 ` Harald Freudenberger
2019-10-29 13:18 ` Richard Henderson
2019-10-30 7:56 ` Harald Freudenberger
2019-10-29 8:22 ` [PATCH 0/6] Improvements for random.h/archrandom.h Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9s6bh2a.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=benh@kernel.crashing.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=richard.henderson@linaro.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox