* scsi: used kmem_cache_zalloc instead of kmem_cache_alloc/memset
@ 2009-02-06 3:04 Wei Yongjun
0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2009-02-06 3:04 UTC (permalink / raw)
To: James Bottomley, linux-scsi; +Cc: LKML
Used kmem_cache_zalloc instead of kmem_cache_alloc/memset.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
drivers/scsi/scsi.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index cbcd3f6..fbe6672 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -169,12 +169,10 @@ scsi_pool_alloc_command(struct scsi_host_cmd_pool *pool, gfp_t gfp_mask)
{
struct scsi_cmnd *cmd;
- cmd = kmem_cache_alloc(pool->cmd_slab, gfp_mask | pool->gfp_mask);
+ cmd = kmem_cache_zalloc(pool->cmd_slab, gfp_mask | pool->gfp_mask);
if (!cmd)
return NULL;
- memset(cmd, 0, sizeof(*cmd));
-
cmd->sense_buffer = kmem_cache_alloc(pool->sense_slab,
gfp_mask | pool->gfp_mask);
if (!cmd->sense_buffer) {
--
1.5.3.8
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-06 3:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06 3:04 scsi: used kmem_cache_zalloc instead of kmem_cache_alloc/memset Wei Yongjun
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).