|
From: openocd-gerrit <ope...@us...> - 2024-10-05 15:54:24
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via edf2c82cf615af4926cc3536bbbafce2c55fe4e0 (commit)
from 30c3d077f281876286a7aa37afbd411d4bd1667e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit edf2c82cf615af4926cc3536bbbafce2c55fe4e0
Author: Jan Matyas <jan...@co...>
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...@co...>
Fixes: 9544cd653df1 ("helper: add align.h")
Reviewed-on: https://review.openocd.org/c/openocd/+/8511
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/helper/align.h b/src/helper/align.h
index 935a6a3b2..d7170065e 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 */
-----------------------------------------------------------------------
Summary of changes:
src/helper/align.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|