crypto - Avoid free() namespace collision
authorArnd Bergmann <arnd@arndb.de>
Thu, 30 Apr 2020 21:30:43 +0000 (23:30 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 May 2020 05:30:41 +0000 (15:30 +1000)
commitd099ea6e6fde5f311bea5bcdadaa85fc3af79259
tree523ff8b901ff00b8df912cb0fabf68ab1c864777
parente0664ebcea6ac5e16da703409fb4bd61f8cd37d9
crypto - Avoid free() namespace collision

gcc-10 complains about using the name of a standard library
function in the kernel, as we are not building with -ffreestanding:

crypto/xts.c:325:13: error: conflicting types for built-in function 'free'; expected 'void(void *)' [-Werror=builtin-declaration-mismatch]
  325 | static void free(struct skcipher_instance *inst)
      |             ^~~~
crypto/lrw.c:290:13: error: conflicting types for built-in function 'free'; expected 'void(void *)' [-Werror=builtin-declaration-mismatch]
  290 | static void free(struct skcipher_instance *inst)
      |             ^~~~
crypto/lrw.c:27:1: note: 'free' is declared in header '<stdlib.h>'

The xts and lrw cipher implementations run into this because they do
not use the conventional namespaced function names.

It might be better to rename all local functions in those files to
help with things like 'ctags' and 'grep', but just renaming these two
avoids the build issue. I picked the more verbose crypto_xts_free()
and crypto_lrw_free() names for consistency with several other drivers
that do use namespaced function names.

Fixes: f1c131b45410 ("crypto: xts - Convert to skcipher")
Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/lrw.c
crypto/xts.c