[dpdk-stable] patch 'hash: explicit casts for truncation in CRC32c' has been queued to stable release 18.02.2

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 15 15:46:28 CEST 2018


Hi,

FYI, your patch has been queued to stable release 18.02.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/16/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From 35420b7eb810b5a27a95c3413e23d0e4f9fcacce Mon Sep 17 00:00:00 2001
From: Andy Green <andy at warmcat.com>
Date: Sat, 12 May 2018 10:00:37 +0800
Subject: [PATCH] hash: explicit casts for truncation in CRC32c

[ upstream commit c981825388f81fb191f5a79c80adf0fdb074e584 ]

In function 'crc32c_sse42_u64_mimic':
rte_hash_crc.h:402:40:
warning: conversion from 'uint64_t' {aka 'long unsigned int'}
to 'uint32_t' {aka 'unsigned int'} may change value [-Wconversion]
  init_val = crc32c_sse42_u32(d.u32[0], init_val);

Fixes: 00bf774bab0b ("hash: add assembly implementation of CRC32 intrinsics")

Signed-off-by: Andy Green <andy at warmcat.com>
Reviewed-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/librte_hash/rte_hash_crc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h
index 5f5fb3db1..cf28031b3 100644
--- a/lib/librte_hash/rte_hash_crc.h
+++ b/lib/librte_hash/rte_hash_crc.h
@@ -398,9 +398,9 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val)
 	} d;
 
 	d.u64 = data;
-	init_val = crc32c_sse42_u32(d.u32[0], init_val);
-	init_val = crc32c_sse42_u32(d.u32[1], init_val);
-	return init_val;
+	init_val = crc32c_sse42_u32(d.u32[0], (uint32_t)init_val);
+	init_val = crc32c_sse42_u32(d.u32[1], (uint32_t)init_val);
+	return (uint32_t)init_val;
 }
 #endif
 
@@ -412,7 +412,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val)
 			"crc32q %[data], %[init_val];"
 			: [init_val] "+r" (init_val)
 			: [data] "rm" (data));
-	return init_val;
+	return (uint32_t)init_val;
 }
 #endif
 
-- 
2.14.2



More information about the stable mailing list