aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2021-06-03 17:49:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-04 15:10:02 +0200
commite63becb7f30830ed142f889bb0894d76df56d3b4 (patch)
treea277a9da800eca8150905708ef52af69e02a597b /drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
parentstaging: vchiq_core: move internals to C source (diff)
downloadlinux-dev-e63becb7f30830ed142f889bb0894d76df56d3b4.tar.xz
linux-dev-e63becb7f30830ed142f889bb0894d76df56d3b4.zip
staging: vchiq_core: get the rid of IS_POW2
The macro IS_POW2 is only used to ensure some size are powers of 2. Better use BUILD_BUG_ON_NOT_POWER_OF_2 for this. Since this must be done in a function, merge all these checks in a new function. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1622735405-9980-5-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index db93495da04c..df5141856449 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -69,13 +69,6 @@
extern int vchiq_static_assert[(cond) ? 1 : -1]
#endif
-#define IS_POW2(x) (x && ((x & (x - 1)) == 0))
-
-/* Ensure that the slot size and maximum number of slots are powers of 2 */
-vchiq_static_assert(IS_POW2(VCHIQ_SLOT_SIZE));
-vchiq_static_assert(IS_POW2(VCHIQ_MAX_SLOTS));
-vchiq_static_assert(IS_POW2(VCHIQ_MAX_SLOTS_PER_SIDE));
-
#define VCHIQ_SLOT_MASK (VCHIQ_SLOT_SIZE - 1)
#define VCHIQ_SLOT_QUEUE_MASK (VCHIQ_MAX_SLOTS_PER_SIDE - 1)
#define VCHIQ_SLOT_ZERO_SLOTS DIV_ROUND_UP(sizeof(struct vchiq_slot_zero), \