[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4376102.svyTz8ADVT@daeseok-laptop.cloud.net>
Date: Wed, 12 Mar 2014 19:37:50 +0900
From: Daeseok Youn <daeseok.youn@...il.com>
To: gregkh@...uxfoundation.org, jkc@...hat.com
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: unisys: use kzalloc instead of kmalloc/memset 0
Signed-off-by: Daeseok Youn <daeseok.youn@...il.com>
---
drivers/staging/unisys/uislib/uislib.c | 5 +----
drivers/staging/unisys/uislib/uisutils.c | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
index d77df9a..9748fcb 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -339,8 +339,6 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
return CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
}
- memset(bus, 0, size);
-
/* Currently by default, the bus Number is the GuestHandle.
* Configure Bus message can override this.
*/
@@ -530,7 +528,6 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
return CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
}
- memset(dev, 0, sizeof(struct device_info));
dev->channelTypeGuid = msg->cmd.createDevice.dataTypeGuid;
dev->intr = msg->cmd.createDevice.intr;
dev->channelAddr = msg->cmd.createDevice.channelAddr;
@@ -1437,7 +1434,7 @@ uislib_malloc(size_t siz, gfp_t gfp, U8 contiguous, char *fn, int ln)
* get memory for you (like, invoke oom killer), which
* will probably cripple the system.
*/
- p = kmalloc(siz, gfp | __GFP_NORETRY);
+ p = kzalloc(siz, gfp | __GFP_NORETRY);
}
if (p == NULL) {
LOGERR("uislib_malloc failed to alloc %d bytes @%s:%d",
diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c
index 208b7ea..2f05be1 100644
--- a/drivers/staging/unisys/uislib/uisutils.c
+++ b/drivers/staging/unisys/uislib/uisutils.c
@@ -294,7 +294,7 @@ ReqHandlerAdd(GUID switchTypeGuid,
rc = UISMALLOC(sizeof(*rc), GFP_ATOMIC);
if (!rc)
return NULL;
- memset(rc, 0, sizeof(*rc));
+
rc->switchTypeGuid = switchTypeGuid;
rc->controlfunc = controlfunc;
rc->min_channel_bytes = min_channel_bytes;
--
1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists