[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <416bba94359006196d099960489036e9c97c9ed7.1251170438.git.joe@perches.com>
Date: Mon, 24 Aug 2009 20:29:43 -0700
From: Joe Perches <joe@...ches.com>
To: netdev@...r.kernel.org
Cc: Anil Murthy <anil.murthy@...erion.com>,
Sreenivasa Honnur <sreenivasa.honnur@...erion.com>,
Sivakumar Subramani <sivakumar.subramani@...erion.com>,
Rastapur Santosh <santosh.rastapur@...erion.com>,
Ramkrishna Vepa <ram.vepa@...erion.com>,
"David S. Miller" <davem@...emloft.net>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-next@...r.kernel.org
Subject: [PATCH 4/9] s2io.c: use kzalloc
Signed-off-by: Joe Perches <joe@...ches.com>
---
drivers/net/s2io.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 75f2209..134cdb3 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3834,7 +3834,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
int size;
size = nic->num_entries * sizeof(struct msix_entry);
- nic->entries = kmalloc(size, GFP_KERNEL);
+ nic->entries = kzalloc(size, GFP_KERNEL);
if (!nic->entries) {
DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", \
__func__);
@@ -3843,10 +3843,8 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
}
nic->mac_control.stats_info->sw_stat.mem_allocated += size;
- memset(nic->entries, 0, size);
-
size = nic->num_entries * sizeof(struct s2io_msix_entry);
- nic->s2io_entries = kmalloc(size, GFP_KERNEL);
+ nic->s2io_entries = kzalloc(size, GFP_KERNEL);
if (!nic->s2io_entries) {
DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n",
__func__);
@@ -3857,7 +3855,6 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
return -ENOMEM;
}
nic->mac_control.stats_info->sw_stat.mem_allocated += size;
- memset(nic->s2io_entries, 0, size);
nic->entries[0].entry = 0;
nic->s2io_entries[0].entry = 0;
--
1.6.3.1.10.g659a0.dirty
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists