[Drbd-dev] [PATCH 04/13] DRBD-receiver: Improve a size determination in drbd_do_features()
SF Markus Elfring
elfring at users.sourceforge.net
Sat Sep 10 22:25:46 CEST 2016
From: Markus Elfring <elfring at 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 at 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
More information about the drbd-dev
mailing list