ethdev: avoid usage of ULL for 64-bit unsigned constants

Message ID 20211022112016.816386-1-andrew.rybchenko@oktetlabs.ru (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: avoid usage of ULL for 64-bit unsigned constants |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues
ci/iol-testing warning apply patch failure

Commit Message

Andrew Rybchenko Oct. 22, 2021, 11:20 a.m. UTC
  Use UINT64_C() macro instead.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
The patch should be applied on top of ethdev namespace addition [1].

[1] https://patches.dpdk.org/project/dpdk/patch/20211022110314.470843-1-ferruh.yigit@intel.com/

 lib/ethdev/rte_ethdev.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Ferruh Yigit Oct. 22, 2021, 5:24 p.m. UTC | #1
On 10/22/2021 12:20 PM, Andrew Rybchenko wrote:
> Use UINT64_C() macro instead.
> 
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 9847b412c5..0238c3f9bd 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -687,23 +687,23 @@  struct rte_eth_rss_conf {
  * It basically stands for the innermost encapsulation level RSS
  * can be performed on according to PMD and device capabilities.
  */
-#define RTE_ETH_RSS_LEVEL_PMD_DEFAULT  (0ULL << 50)
+#define RTE_ETH_RSS_LEVEL_PMD_DEFAULT  (UINT64_C(0) << 50)
 #define ETH_RSS_LEVEL_PMD_DEFAULT      RTE_ETH_RSS_LEVEL_PMD_DEFAULT
 
 /**
  * level 1, requests RSS to be performed on the outermost packet
  * encapsulation level.
  */
-#define RTE_ETH_RSS_LEVEL_OUTERMOST    (1ULL << 50)
+#define RTE_ETH_RSS_LEVEL_OUTERMOST    (UINT64_C(1) << 50)
 #define ETH_RSS_LEVEL_OUTERMOST        RTE_ETH_RSS_LEVEL_OUTERMOST
 
 /**
  * level 2, requests RSS to be performed on the specified inner packet
  * encapsulation level, from outermost to innermost (lower to higher values).
  */
-#define RTE_ETH_RSS_LEVEL_INNERMOST    (2ULL << 50)
+#define RTE_ETH_RSS_LEVEL_INNERMOST    (UINT64_C(2) << 50)
 #define ETH_RSS_LEVEL_INNERMOST        RTE_ETH_RSS_LEVEL_INNERMOST
-#define RTE_ETH_RSS_LEVEL_MASK         (3ULL << 50)
+#define RTE_ETH_RSS_LEVEL_MASK         (UINT64_C(3) << 50)
 #define ETH_RSS_LEVEL_MASK             RTE_ETH_RSS_LEVEL_MASK
 
 #define RTE_ETH_RSS_LEVEL(rss_hf) ((rss_hf & RTE_ETH_RSS_LEVEL_MASK) >> 50)