30 lines
1.2 KiB
Diff
30 lines
1.2 KiB
Diff
From: Sergei Zviagintsev <sergei@s15v.net>
|
|
Date: Wed, 17 Jun 2015 19:33:27 +0300
|
|
Subject: [PATCH] selftests/kdbus: drop duplicated code from __kdbus_msg_send()
|
|
|
|
Set value of `size' in one step instead of four.
|
|
|
|
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>
|
|
---
|
|
tools/testing/selftests/kdbus/kdbus-util.c | 5 +----
|
|
1 file changed, 1 insertion(+), 4 deletions(-)
|
|
|
|
diff --git a/tools/testing/selftests/kdbus/kdbus-util.c b/tools/testing/selftests/kdbus/kdbus-util.c
|
|
index 5b924531d938..d35ec89cb816 100644
|
|
--- a/tools/testing/selftests/kdbus/kdbus-util.c
|
|
+++ b/tools/testing/selftests/kdbus/kdbus-util.c
|
|
@@ -462,10 +462,7 @@ static int __kdbus_msg_send(const struct kdbus_conn *conn,
|
|
int memfd = -1;
|
|
int ret;
|
|
|
|
- size = sizeof(*msg);
|
|
- size += KDBUS_ITEM_SIZE(sizeof(struct kdbus_vec));
|
|
- size += KDBUS_ITEM_SIZE(sizeof(struct kdbus_vec));
|
|
- size += KDBUS_ITEM_SIZE(sizeof(struct kdbus_vec));
|
|
+ size = sizeof(*msg) + 3 * KDBUS_ITEM_SIZE(sizeof(struct kdbus_vec));
|
|
|
|
if (dst_id == KDBUS_DST_ID_BROADCAST)
|
|
size += KDBUS_ITEM_SIZE(sizeof(struct kdbus_bloom_filter)) + 64;
|