Whamcloud - gitweb
LU-13127 ptlrpc: avoid ISO C90 mixed declaration 77/39677/8
authorMikhail Pershin <mpershin@whamcloud.com>
Fri, 14 Aug 2020 09:55:06 +0000 (12:55 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 12 Sep 2020 15:44:04 +0000 (15:44 +0000)
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>
lustre/ptlrpc/pack_generic.c

index 33b491c..f7c524b 100644 (file)
@@ -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);