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


Groups > linux.kernel > #1480703

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

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 04/13] DRBD-receiver: Improve a size determination in drbd_do_features()
Date 2016-09-10 22:30 +0200
Message-ID <sfX4t-4Pv-19@gated-at.bofh.it> (permalink)
References <sfX4t-4Pv-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[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

csiph-web