helper/align.h: Fix macro IS_PWR_OF_2master
commitedf2c82cf615af4926cc3536bbbafce2c55fe4e0
authorJan Matyas <jan.matyas@codasip.com>
Fri, 27 Sep 2024 07:49:52 +0000 (27 09:49 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 5 Oct 2024 15:53:43 +0000 (5 15:53 +0000)
treef07cd034e73f01accc65d88cf8d1f45191f09912
parent30c3d077f281876286a7aa37afbd411d4bd1667e
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.matyas@codasip.com>
Fixes: 9544cd653df1 ("helper: add align.h")
Reviewed-on: https://review.openocd.org/c/openocd/+/8511
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
src/helper/align.h