Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757071AbbFQOTu (ORCPT ); Wed, 17 Jun 2015 10:19:50 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:39980 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756814AbbFQOTR (ORCPT ); Wed, 17 Jun 2015 10:19:17 -0400 X-Sasl-enc: g0qQaFulCD1j/143gu/ntRC5mH4wh2CWlVOVLNpCbzN9 1434550755 From: Sergei Zviagintsev To: Greg Kroah-Hartman , Daniel Mack , David Herrmann , Djalal Harouni Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Sergei Zviagintsev Subject: [PATCH] selftests/kdbus: drop duplicated code from __kdbus_msg_send() Date: Wed, 17 Jun 2015 17:18:16 +0300 Message-Id: <1434550697-24785-4-git-send-email-sergei@s15v.net> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1180 Lines: 31 Set value of `size' in one step instead of four. Signed-off-by: Sergei Zviagintsev --- 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 f9102264cfb9..ae81da63d810 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; -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/