Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755490AbbK0V37 (ORCPT ); Fri, 27 Nov 2015 16:29:59 -0500 Received: from mailrelay119.isp.belgacom.be ([195.238.20.146]:2817 "EHLO mailrelay119.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754791AbbK0V3x (ORCPT ); Fri, 27 Nov 2015 16:29:53 -0500 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B/AgC5ylhW/6YUtFtegmlSgUK8BYIaAQ2BZIYPAoE+ORQBAQEBAQEBgQqENQEBBCcvIxBROR4ZiDIBsnCKDgEBCCOGVIolhBIFlleNOI8xjTAfAQFChAU9NIVSAQEB From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Philipp Reisner , Fabian Frederick , Lars Ellenberg , drbd-dev@lists.linbit.com Subject: [PATCH 14/21] drbd: clean-up receive_SyncParam() Date: Fri, 27 Nov 2015 22:29:29 +0100 Message-Id: <1448659775-13596-5-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448659775-13596-1-git-send-email-fabf@skynet.be> References: <1448659575-13485-1-git-send-email-fabf@skynet.be> <1448659775-13596-1-git-send-email-fabf@skynet.be> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1337 Lines: 44 Initialize header_size then data_size once. Signed-off-by: Fabian Frederick --- drivers/block/drbd/drbd_receiver.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index ad9b99b..3ca6516 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3556,18 +3556,16 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i return -EIO; } - if (apv <= 88) { + if (apv <= 88) header_size = sizeof(struct p_rs_param); - data_size = pi->size - header_size; - } else if (apv <= 94) { + else if (apv <= 94) header_size = sizeof(struct p_rs_param_89); - data_size = pi->size - header_size; - D_ASSERT(device, data_size == 0); - } else { + else header_size = sizeof(struct p_rs_param_95); - data_size = pi->size - header_size; + + data_size = pi->size - header_size; + if (apv > 88) D_ASSERT(device, data_size == 0); - } /* initialize verify_alg and csums_alg */ p = pi->data; -- 2.1.4 -- 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/