Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
dpdk-thunderx.28203
0005-lib-fix-shifting-32-bit-signed-variable-31...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0005-lib-fix-shifting-32-bit-signed-variable-31-times.patch of Package dpdk-thunderx.28203
From e710f44f98fcc6906174fc7a8feed9b0bb3be6a5 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit <ferruh.yigit@intel.com> Date: Sun, 28 Oct 2018 01:08:44 +0000 Subject: [PATCH] lib: fix shifting 32-bit signed variable 31 times Fix cppcheck warning by marking variable as unsigned. Fixes: dc276b5780c2 ("acl: new library") Fixes: 986ff526fb84 ("net: add CRC computation API") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@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 ea557ab91..d74761325 100644 --- a/lib/librte_acl/acl_gen.c +++ b/lib/librte_acl/acl_gen.c @@ -192,7 +192,7 @@ 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++; last_bit = 1; diff --git a/lib/librte_net/rte_net_crc.c b/lib/librte_net/rte_net_crc.c index 0c1bf51af..b68d25c54 100644 --- a/lib/librte_net/rte_net_crc.c +++ b/lib/librte_net/rte_net_crc.c @@ -98,8 +98,8 @@ reflect_32bits(uint32_t val) uint32_t i, res = 0; 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.16.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor