Re: [PATCH -next] crypto: atmel - Fix randbuild error

From: Herbert Xu
Date: Mon Nov 11 2019 - 21:14:13 EST


On Mon, Nov 11, 2019 at 09:39:01PM +0800, YueHaibing wrote:
> If CRYPTO_AUTHENC is m, CRYPTO_DEV_ATMEL_SHA is m, but
> CRYPTO_DEV_ATMEL_AES is y, building will fails:
>
> drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_init_tfm':
> atmel-aes.c:(.text+0x670): undefined reference to `atmel_sha_authenc_get_reqsize'
> atmel-aes.c:(.text+0x67a): undefined reference to `atmel_sha_authenc_spawn'
> drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_setkey':
> atmel-aes.c:(.text+0x7e5): undefined reference to `atmel_sha_authenc_setkey'
>
> Fix this by moving the selection of CRYPTO_DEV_ATMEL_SHA under
> CRYPTO_DEV_ATMEL_AES.
>
> Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
> Fixes: 89a82ef87e01 ("crypto: atmel-authenc - add support to...")
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>

This patch shows that moving CRYPTO_AUTHENC over was just papering
over a real problem. Applying your patch essentially makes SHA
the same option as AES.

What we should do instead is turn DEV_ATMEL_AUTHENC into a bool,
and then add these to DEV_ATMEL_AES:

select CRYPTO_AUTHENC if CRYPTO_DEV_ATMEL_AUTHENC
select CRYPTO_DEV_ATMEL_SHA if CRYPTO_DEV_ATMEL_AUTHENC

Could you please do this and repost?

Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt