From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
rds-devel@oss.oracle.com, "David S. Miller" <davem@davemloft.net>,
Santosh Shilimkar <santosh.shilimkar@oracle.com>,
Sowmini Varadhan <sowmini.varadhan@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/3] RDS: IB: Improve a size determination in rds_ib_add_one()
Date: Mon, 22 May 2017 16:12:21 +0200 [thread overview]
Message-ID: <e8486283-62ac-ea77-1169-edca3e630637@users.sourceforge.net> (raw)
In-Reply-To: <44b46c51-3665-5f14-dd3b-6e6f230258a7@users.sourceforge.net>
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(-)
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;
--
2.13.0
next prev parent reply other threads:[~2017-05-22 14:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 14:10 [PATCH 0/3] RDS: Adjustments for two function implementations SF Markus Elfring
2017-05-22 14:11 ` [PATCH 1/3] RDS: IB: Delete an error message for a failed memory allocation in rds_ib_add_one() SF Markus Elfring
2017-05-22 19:24 ` Santosh Shilimkar
2017-05-22 14:12 ` SF Markus Elfring [this message]
2017-05-22 19:22 ` [PATCH 2/3] RDS: IB: Improve a size determination " Santosh Shilimkar
2017-05-22 14:13 ` [PATCH 3/3] RDS: TCP: Delete an error message for a failed memory allocation in rds_tcp_init_net() SF Markus Elfring
2017-05-22 14:26 ` Sowmini Varadhan
2017-05-22 14:32 ` SF Markus Elfring
2017-05-22 14:46 ` Sowmini Varadhan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e8486283-62ac-ea77-1169-edca3e630637@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.com \
--cc=sowmini.varadhan@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®