Avoid forbidden mixed declaration in lustre_msg_calc_cksum()
Test-Parameters: trivial
Fixes:
726897c87c42 ("LU-13127 ptlrpc: don't require CONFIG_CRYPTO_CRC32")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I180eefd979331f3fa206aa9b1d54c8e7b17bcbee
Reviewed-on: https://review.whamcloud.com/39677
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
__u32 len = lustre_msg_buflen(msg, buf);
__u32 crc;
__u32 len = lustre_msg_buflen(msg, buf);
__u32 crc;
- LASSERTF(pb != NULL, "invalid msg %p: no ptlrpc body!\n", msg);
#if IS_ENABLED(CONFIG_CRC32)
/* about 10x faster than crypto_hash for small buffers */
crc = crc32_le(~(__u32)0, (unsigned char *)pb, len);
#elif IS_ENABLED(CONFIG_CRYPTO_CRC32)
unsigned int hsize = 4;
#if IS_ENABLED(CONFIG_CRC32)
/* about 10x faster than crypto_hash for small buffers */
crc = crc32_le(~(__u32)0, (unsigned char *)pb, len);
#elif IS_ENABLED(CONFIG_CRYPTO_CRC32)
unsigned int hsize = 4;
cfs_crypto_hash_digest(CFS_HASH_ALG_CRC32, (unsigned char *)pb,
len, NULL, 0, (unsigned char *)&crc,
&hsize);
cfs_crypto_hash_digest(CFS_HASH_ALG_CRC32, (unsigned char *)pb,
len, NULL, 0, (unsigned char *)&crc,
&hsize);