From: Mikhail Pershin Date: Fri, 14 Aug 2020 09:55:06 +0000 (+0300) Subject: LU-13127 ptlrpc: avoid ISO C90 mixed declaration X-Git-Tag: 2.13.56~43 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=4a9ea62c6ac8d0f1ae8807aed78415adef4edc58;p=fs%2Flustre-release.git LU-13127 ptlrpc: avoid ISO C90 mixed declaration 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 Change-Id: I180eefd979331f3fa206aa9b1d54c8e7b17bcbee Reviewed-on: https://review.whamcloud.com/39677 Tested-by: jenkins Reviewed-by: James Simmons Reviewed-by: Neil Brown Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 33b491c..f7c524b 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -1384,12 +1384,12 @@ __u32 lustre_msg_calc_cksum(struct lustre_msg *msg, __u32 buf) __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; + cfs_crypto_hash_digest(CFS_HASH_ALG_CRC32, (unsigned char *)pb, len, NULL, 0, (unsigned char *)&crc, &hsize);