Skip to content

framework: update FWK_IS_VALUE_POWER_OF_TWO macro

Shaileshwar Mahadevabatla requested to merge shamah01/fwk/power_of_two_macro into main

Modify the FWK_IS_VALUE_POWER_OF_TWO macro to address cppcheck warnings encountered with unsigned integers in the previous version. The revised macro ensures proper handling of both signed and unsigned integers by checking if a value is positive and a power of two.

The specific cppcheck warning encountered was: "Checking if unsigned expression 'page_size' is less than zero. [unsignedLessThanZero]."

if (FWK_IS_ALIGNED(region->phy_addr_base, page_size) != true) {
    ^

Change-Id: I59c42016f207956ec07f557714cadd946ad58a91

Merge request reports