[PATCH v1 13/25] net/ntnic: add explicitly specificator

Oleksandr Kolomeiets okl-plv at napatech.com
Wed Apr 30 15:48:25 CEST 2025


From: Danylo Vodopianov <dvo-plv at napatech.com>

Add unsigned long long type to the value to ensure that
the value 1 is explicitly treated as a 64-bit unsigned integer.

Signed-off-by: Danylo Vodopianov <dvo-plv at napatech.com>
---
 .../nthw/flow_api/profile_inline/flow_api_profile_inline.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
index c674531396..3fb867c993 100644
--- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
+++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
@@ -114,7 +114,7 @@ static inline uint64_t convert_policing_parameter(uint64_t value)
 	}
 
 	if (shift != 0) {
-		uint64_t tmp = POLICING_PARAMETER_OFFSET * (1 << (shift - 1));
+		uint64_t tmp = POLICING_PARAMETER_OFFSET * (1ULL << (shift - 1ULL));
 
 		if (tmp > value) {
 			res = 0;
-- 
2.47.1



More information about the dev mailing list