This is an automated email from Gerrit.

"Jan Matyas <jan.mat...@codasip.com>" just uploaded a new patch set to Gerrit, 
which you can find at https://review.openocd.org/c/openocd/+/8511

-- gerrit

commit 33dc4dbe7ab83d2ef613452be99860ff8148d6d5
Author: Jan Matyas <jan.mat...@codasip.com>
Date:   Fri Sep 27 09:49:52 2024 +0200

    helper/align.h: Fix macro IS_PWR_OF_2
    
    Zero is not a power of two.
    
    All functions that use IS_PWR_OF_2 were checked and the edge case
    of IS_PWR_OF_2(0) does not occur anywhere at the moment. Therefore
    the fix is safe.
    
    Change-Id: I84d9f9c64c9a7df452ca6e99c2ee4169ccb2b0be
    Signed-off-by: Jan Matyas <jan.mat...@codasip.com>

diff --git a/src/helper/align.h b/src/helper/align.h
index 935a6a3b26..3b5525784d 100644
--- a/src/helper/align.h
+++ b/src/helper/align.h
@@ -24,7 +24,7 @@
 #define IS_PWR_OF_2(x)                  \
 ({                                      \
        typeof(x) _x = (x);                 \
-       _x == 0 || (_x & (_x - 1)) == 0;    \
+       _x != 0 || (_x & (_x - 1)) == 0;    \
 })
 
 #endif /* OPENOCD_HELPER_ALIGN_H */

-- 

Reply via email to