On 5/27/2025 3:17 PM, Dhanya Pillai wrote:
From: Lukasz Krakowiak <lukaszx.krakow...@intel.com>

Fix issue related to INTEGER_OVERFLOW.

I would also suggest rewording the commit message. Even something like the following would be better:

Fix integer overflow issue in power of 2 calculation.


Fixes: f636f2888cec ("net/ice/base: move and add some help function and macros")
Cc: sta...@dpdk.org
Signed-off-by: Lukasz Krakowiak <lukaszx.krakow...@intel.com>
Signed-off-by: Dhanya Pillai <dhanya.r.pil...@intel.com>
---
  drivers/net/intel/ice/base/ice_type.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/intel/ice/base/ice_type.h 
b/drivers/net/intel/ice/base/ice_type.h
index 297a5ea890..ae3b944d6e 100644
--- a/drivers/net/intel/ice/base/ice_type.h
+++ b/drivers/net/intel/ice/base/ice_type.h
@@ -25,7 +25,7 @@
   */
  static inline bool ice_is_pow2(u64 val)
  {
-       return (val && !(val & (val - 1)));
+       return val != 0 && (val & (val - 1)) == 0;
  }
/**


--
Thanks,
Anatoly

Reply via email to