summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2021-06-03 17:49:57 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-04 15:10:02 +0200
commita6dd3f26175298ff1a3283bee7273905563f28bc (patch)
tree57c0c57cec5a9548603fbd2111f957a80cd21fe0
parent525dd8a36c3323ebfca54ccbf3aa79f19901f554 (diff)
staging: vchiq_core: use define for message type shift
Make it clear and use a define for shifting the message type. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1622735405-9980-9-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 0afac4696185..f6ada95004cc 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -33,12 +33,14 @@
#define VCHIQ_MSG_REMOTE_RELEASE 13 /* - */
#define VCHIQ_MSG_REMOTE_USE_ACTIVE 14 /* - */
+#define TYPE_SHIFT 24
+
#define VCHIQ_PORT_MAX (VCHIQ_MAX_SERVICES - 1)
#define VCHIQ_PORT_FREE 0x1000
#define VCHIQ_PORT_IS_VALID(port) ((port) < VCHIQ_PORT_FREE)
#define VCHIQ_MAKE_MSG(type, srcport, dstport) \
- (((type) << 24) | ((srcport) << 12) | ((dstport) << 0))
-#define VCHIQ_MSG_TYPE(msgid) ((unsigned int)(msgid) >> 24)
+ (((type) << TYPE_SHIFT) | ((srcport) << 12) | ((dstport) << 0))
+#define VCHIQ_MSG_TYPE(msgid) ((unsigned int)(msgid) >> TYPE_SHIFT)
#define VCHIQ_MSG_SRCPORT(msgid) \
(unsigned short)(((unsigned int)(msgid) >> 12) & 0xfff)
#define VCHIQ_MSG_DSTPORT(msgid) \