netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rds-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org,
	"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Santosh Shilimkar
	<santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	Sowmini Varadhan
	<sowmini.varadhan-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>

From: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
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-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  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
     [not found]   ` <e3491aaa-f471-c67c-43dc-41d592159c8e-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-05-22 19:24     ` Santosh Shilimkar
     [not found] ` <44b46c51-3665-5f14-dd3b-6e6f230258a7-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-05-22 14:12   ` SF Markus Elfring [this message]
     [not found]     ` <e8486283-62ac-ea77-1169-edca3e630637-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
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
     [not found]   ` <5d523cf8-1540-e704-2301-a5e0205cb536-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
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-rn4veauk+akrv+lv9mx5uipxlwaovq5f@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rds-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org \
    --cc=santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=sowmini.varadhan-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).