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

From: SF Markus Elfring
Date: Sat Sep 10 2016 - 16:26:03 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
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