From: Roland Dreier <rolandd@cisco.com>
To: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [git patch review 3/7] IB/mthca: kzalloc conversions
Date: Tue, 10 Jan 2006 19:31:23 +0000 [thread overview]
Message-ID: <1136921483290-3d1a8ae2f0b61cbf@cisco.com> (raw)
In-Reply-To: <1136921483290-79d0774f48f3f587@cisco.com>
Convert kmalloc()/memset(,0,) pairs to kzalloc().
Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
drivers/infiniband/hw/mthca/mthca_provider.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
105e50a5e8f184af31daffce4d7bfd7771fe213f
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 30b67c2..0ae27fa 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -55,7 +55,7 @@ static int mthca_query_device(struct ib_
u8 status;
- in_mad = kmalloc(sizeof *in_mad, GFP_KERNEL);
+ in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL);
if (!in_mad || !out_mad)
goto out;
@@ -64,7 +64,6 @@ static int mthca_query_device(struct ib_
props->fw_ver = mdev->fw_ver;
- memset(in_mad, 0, sizeof *in_mad);
in_mad->base_version = 1;
in_mad->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED;
in_mad->class_version = 1;
@@ -128,14 +127,13 @@ static int mthca_query_port(struct ib_de
int err = -ENOMEM;
u8 status;
- in_mad = kmalloc(sizeof *in_mad, GFP_KERNEL);
+ in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL);
if (!in_mad || !out_mad)
goto out;
memset(props, 0, sizeof *props);
- memset(in_mad, 0, sizeof *in_mad);
in_mad->base_version = 1;
in_mad->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED;
in_mad->class_version = 1;
@@ -220,12 +218,11 @@ static int mthca_query_pkey(struct ib_de
int err = -ENOMEM;
u8 status;
- in_mad = kmalloc(sizeof *in_mad, GFP_KERNEL);
+ in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL);
if (!in_mad || !out_mad)
goto out;
- memset(in_mad, 0, sizeof *in_mad);
in_mad->base_version = 1;
in_mad->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED;
in_mad->class_version = 1;
@@ -259,12 +256,11 @@ static int mthca_query_gid(struct ib_dev
int err = -ENOMEM;
u8 status;
- in_mad = kmalloc(sizeof *in_mad, GFP_KERNEL);
+ in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL);
if (!in_mad || !out_mad)
goto out;
- memset(in_mad, 0, sizeof *in_mad);
in_mad->base_version = 1;
in_mad->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED;
in_mad->class_version = 1;
--
1.0.7
next prev parent reply other threads:[~2006-01-10 19:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-10 19:31 [git patch review 1/7] IB/mthca: fix page shift calculation in mthca_reg_phys_mr() Roland Dreier
2006-01-10 19:31 ` [git patch review 2/7] IB/mthca: prevent event queue overrun Roland Dreier
2006-01-10 19:31 ` Roland Dreier [this message]
2006-01-10 19:31 ` [git patch review 4/7] IB/mthca: Factor common MAD initialization code Roland Dreier
2006-01-10 19:31 ` [git patch review 5/7] IB: Add node_guid to struct ib_device Roland Dreier
2006-01-10 19:31 ` [git patch review 6/7] IPoIB: Fix error path in ipoib_mcast_dev_flush() Roland Dreier
2006-01-10 19:31 ` [git patch review 7/7] IPoIB: Fix address handle refcounting for multicast groups Roland Dreier
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=1136921483290-3d1a8ae2f0b61cbf@cisco.com \
--to=rolandd@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=openib-general@openib.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
all inboxes | Powered by JetHome®