From: Andy Green Date: Sat, 12 May 2018 02:00:32 +0000 (+0800) Subject: hash: move stack declaration at top of CRC32c function X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f1eb05a1dc64e17bb9d9b6ad29b78f181aae36b8;p=dpdk.git hash: move stack declaration at top of CRC32c function In function 'crc32c_2words': rte_hash_crc.h:347:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] uint32_t crc, term1, term2; Fixes: d983cf41698f ("hash: add software CRC32 implementation") Cc: stable@dpdk.org Signed-off-by: Andy Green Reviewed-by: Stephen Hemminger --- diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h index 479f84b149..5f5fb3db18 100644 --- a/lib/librte_hash/rte_hash_crc.h +++ b/lib/librte_hash/rte_hash_crc.h @@ -338,14 +338,13 @@ crc32c_1word(uint32_t data, uint32_t init_val) static inline uint32_t crc32c_2words(uint64_t data, uint32_t init_val) { + uint32_t crc, term1, term2; union { uint64_t u64; uint32_t u32[2]; } d; d.u64 = data; - uint32_t crc, term1, term2; - crc = init_val; crc ^= d.u32[0];