33 lines
1.2 KiB
Diff
33 lines
1.2 KiB
Diff
From: Sergei Zviagintsev <sergei@s15v.net>
|
|
Date: Wed, 10 Jun 2015 00:00:08 +0300
|
|
Subject: [PATCH] samples/kdbus: use parentheses uniformly in KDBUS_FOREACH
|
|
macro
|
|
|
|
Enclose all arguments into parentheses to stay consistent across the
|
|
whole macro.
|
|
|
|
Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
|
|
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
|
|
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
---
|
|
samples/kdbus/kdbus-api.h | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/samples/kdbus/kdbus-api.h b/samples/kdbus/kdbus-api.h
|
|
index fab873b89d97..7f3abae18396 100644
|
|
--- a/samples/kdbus/kdbus-api.h
|
|
+++ b/samples/kdbus/kdbus-api.h
|
|
@@ -10,10 +10,10 @@
|
|
#define KDBUS_ITEM_NEXT(item) \
|
|
(typeof(item))((uint8_t *)(item) + KDBUS_ALIGN8((item)->size))
|
|
#define KDBUS_FOREACH(iter, first, _size) \
|
|
- for (iter = (first); \
|
|
+ for ((iter) = (first); \
|
|
((uint8_t *)(iter) < (uint8_t *)(first) + (_size)) && \
|
|
((uint8_t *)(iter) >= (uint8_t *)(first)); \
|
|
- iter = (void *)(((uint8_t *)iter) + KDBUS_ALIGN8((iter)->size)))
|
|
+ (iter) = (void *)((uint8_t *)(iter) + KDBUS_ALIGN8((iter)->size)))
|
|
|
|
static inline int kdbus_cmd_bus_make(int control_fd, struct kdbus_cmd *cmd)
|
|
{
|