OSDN Git Service

lib/string: Make memzero_explicit() inline instead of external
authorArvind Sankar <nivedita@alum.mit.edu>
Mon, 7 Oct 2019 22:00:02 +0000 (18:00 -0400)
committerIngo Molnar <mingo@kernel.org>
Tue, 8 Oct 2019 11:27:05 +0000 (13:27 +0200)
commitbec500777089b3c96c53681fc0aa6fee59711d4a
tree6e18458897b6246afc04242d3e38dcaf032e366c
parentfbcfb8f0270bf24fe348393540b17a7f2ba577d7
lib/string: Make memzero_explicit() inline instead of external

With the use of the barrier implied by barrier_data(), there is no need
for memzero_explicit() to be extern. Making it inline saves the overhead
of a function call, and allows the code to be reused in arch/*/purgatory
without having to duplicate the implementation.

Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H . Peter Anvin <hpa@zytor.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephan Mueller <smueller@chronox.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-crypto@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Fixes: 906a4bb97f5d ("crypto: sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit")
Link: https://lkml.kernel.org/r/20191007220000.GA408752@rani.riverdale.lan
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/string.h
lib/string.c