[dpdk-stable] patch 'lib: fix shifting 32-bit signed variable 31 times' has been queued to stable release 18.08.1
Kevin Traynor
ktraynor at redhat.com
Fri Nov 23 11:26:52 CET 2018
Hi,
FYI, your patch has been queued to stable release 18.08.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/29/18. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.
Thanks.
Kevin Traynor
---
>From 085051008e491e50fe91b1863003f41b6281127e Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Sun, 28 Oct 2018 01:08:44 +0000
Subject: [PATCH] lib: fix shifting 32-bit signed variable 31 times
[ upstream commit 9eb06884120091a21fdfc35850167f6245c2109e ]
Fix cppcheck warning by marking variable as unsigned.
Fixes: dc276b5780c2 ("acl: new library")
Fixes: 986ff526fb84 ("net: add CRC computation API")
Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
lib/librte_acl/acl_gen.c | 2 +-
lib/librte_net/rte_net_crc.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/librte_acl/acl_gen.c b/lib/librte_acl/acl_gen.c
index bed66be08..35a0140b4 100644
--- a/lib/librte_acl/acl_gen.c
+++ b/lib/librte_acl/acl_gen.c
@@ -164,5 +164,5 @@ acl_count_sequential_groups(struct rte_acl_bitset *bits, int zero_one)
for (n = QRANGE_MIN; n < UINT8_MAX + 1; n++) {
if (bits->bits[n / (sizeof(bits_t) * 8)] &
- (1 << (n % (sizeof(bits_t) * 8)))) {
+ (1U << (n % (sizeof(bits_t) * 8)))) {
if (zero_one == 1 && last_bit != 1)
ranges++;
diff --git a/lib/librte_net/rte_net_crc.c b/lib/librte_net/rte_net_crc.c
index 73ac3a959..dca0830e2 100644
--- a/lib/librte_net/rte_net_crc.c
+++ b/lib/librte_net/rte_net_crc.c
@@ -70,6 +70,6 @@ reflect_32bits(uint32_t val)
for (i = 0; i < 32; i++)
- if ((val & (1 << i)) != 0)
- res |= (uint32_t)(1 << (31 - i));
+ if ((val & (1U << i)) != 0)
+ res |= (uint32_t)(1U << (31 - i));
return res;
--
2.19.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2018-11-23 10:22:55.508423003 +0000
+++ 0048-lib-fix-shifting-32-bit-signed-variable-31-times.patch 2018-11-23 10:22:54.000000000 +0000
@@ -1,13 +1,14 @@
-From 9eb06884120091a21fdfc35850167f6245c2109e Mon Sep 17 00:00:00 2001
+From 085051008e491e50fe91b1863003f41b6281127e Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Sun, 28 Oct 2018 01:08:44 +0000
Subject: [PATCH] lib: fix shifting 32-bit signed variable 31 times
+[ upstream commit 9eb06884120091a21fdfc35850167f6245c2109e ]
+
Fix cppcheck warning by marking variable as unsigned.
Fixes: dc276b5780c2 ("acl: new library")
Fixes: 986ff526fb84 ("net: add CRC computation API")
-Cc: stable at dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
More information about the stable
mailing list