summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/device.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2005-11-02 07:23:14 -0800
committerRoland Dreier <rolandd@cisco.com>2005-11-02 07:23:14 -0800
commitde6eb66b56d9df5ce6bd254994f05e065214e8cd (patch)
tree7463446a05b5e9a5d2fc400da0be8d4a6c2ff6f1 /drivers/infiniband/core/device.c
parent7b28b0d000eeb62d77add636f5d6eb0da04e48aa (diff)
downloadlinux-de6eb66b56d9df5ce6bd254994f05e065214e8cd.tar.bz2
[IB] kzalloc() conversions
Replace kmalloc()+memset(,0,) with kzalloc(), for a net savings of 35 source lines and about 500 bytes of text. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r--drivers/infiniband/core/device.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 5a6e44976405..e169e798354b 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -161,17 +161,9 @@ static int alloc_name(char *name)
*/
struct ib_device *ib_alloc_device(size_t size)
{
- void *dev;
-
BUG_ON(size < sizeof (struct ib_device));
- dev = kmalloc(size, GFP_KERNEL);
- if (!dev)
- return NULL;
-
- memset(dev, 0, size);
-
- return dev;
+ return kzalloc(size, GFP_KERNEL);
}
EXPORT_SYMBOL(ib_alloc_device);