From 4a9ea62c6ac8d0f1ae8807aed78415adef4edc58 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Fri, 14 Aug 2020 12:55:06 +0300 Subject: [PATCH] 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 --- lustre/ptlrpc/pack_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 1.8.3.1