[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1448659775-13596-5-git-send-email-fabf@skynet.be>
Date: Fri, 27 Nov 2015 22:29:29 +0100
From: Fabian Frederick <fabf@...net.be>
To: linux-kernel@...r.kernel.org
Cc: Philipp Reisner <philipp.reisner@...bit.com>,
Fabian Frederick <fabf@...net.be>,
Lars Ellenberg <lars.ellenberg@...bit.com>,
drbd-dev@...ts.linbit.com
Subject: [PATCH 14/21] drbd: clean-up receive_SyncParam()
Initialize header_size then data_size once.
Signed-off-by: Fabian Frederick <fabf@...net.be>
---
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists