diff mbox

[2/3] RDS: IB: Improve a size determination in rds_ib_add_one()

Message ID e8486283-62ac-ea77-1169-edca3e630637@users.sourceforge.net
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

SF Markus Elfring May 22, 2017, 2:12 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 22 May 2017 15:40:21 +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>
---
 net/rds/ib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Santosh Shilimkar May 22, 2017, 7:22 p.m. UTC | #1
On 5/22/2017 7:12 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 22 May 2017 15:40:21 +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>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
diff mbox

Patch

diff --git a/net/rds/ib.c b/net/rds/ib.c
index c5514d058171..ed37bf011704 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -131,7 +131,7 @@  static void rds_ib_add_one(struct ib_device *device)
 	if (device->node_type != RDMA_NODE_IB_CA)
 		return;
 
-	rds_ibdev = kzalloc_node(sizeof(struct rds_ib_device), GFP_KERNEL,
+	rds_ibdev = kzalloc_node(sizeof(*rds_ibdev), GFP_KERNEL,
 				 ibdev_to_node(device));
 	if (!rds_ibdev)
 		return;