Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1480703 > unrolled thread

[PATCH 04/13] DRBD-receiver: Improve a size determination in drbd_do_features()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-09-10 22:30 +0200
Last post2016-09-10 22:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 04/13] DRBD-receiver: Improve a size determination in  drbd_do_features() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 22:30 +0200

#1480703 — [PATCH 04/13] DRBD-receiver: Improve a size determination in drbd_do_features()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-10 22:30 +0200
Subject[PATCH 04/13] DRBD-receiver: Improve a size determination in drbd_do_features()
Message-ID<sfX4t-4Pv-19@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Sep 2016 19:46:05 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/block/drbd/drbd_receiver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 5526f6b..b5a3cf0 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -5208,7 +5208,7 @@ static int drbd_do_features(struct drbd_connection *connection)
 {
 	/* ASSERT current == connection->receiver ... */
 	struct p_connection_features *p;
-	const int expect = sizeof(struct p_connection_features);
+	const int expect = sizeof(*p);
 	struct packet_info pi;
 	int err;
 
-- 
2.10.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web