aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/rsrc_nonstatic.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-12-11 15:18:26 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 18:28:06 -0500
commit8084b372adac9c24ff7abdd939b2e8816e7b88a3 (patch)
treea4a4005d7b025abc0a3e7693404abd0abbfd434b /drivers/pcmcia/rsrc_nonstatic.c
parent6423efaacbf0bce6372897e793d8450c1c08ec8d (diff)
[PATCH] pcmcia: kzalloc conversion
Convert users of kmalloc and memset to kzalloc Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/rsrc_nonstatic.c')
-rw-r--r--drivers/pcmcia/rsrc_nonstatic.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 6b18092205b1..5301ac60358f 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -75,10 +75,9 @@ static DECLARE_MUTEX(rsrc_sem);
75static struct resource * 75static struct resource *
76make_resource(unsigned long b, unsigned long n, int flags, char *name) 76make_resource(unsigned long b, unsigned long n, int flags, char *name)
77{ 77{
78 struct resource *res = kmalloc(sizeof(*res), GFP_KERNEL); 78 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
79 79
80 if (res) { 80 if (res) {
81 memset(res, 0, sizeof(*res));
82 res->name = name; 81 res->name = name;
83 res->start = b; 82 res->start = b;
84 res->end = b + n - 1; 83 res->end = b + n - 1;
@@ -200,12 +199,11 @@ static void do_io_probe(struct pcmcia_socket *s, kio_addr_t base, kio_addr_t num
200 base, base+num-1); 199 base, base+num-1);
201 200
202 /* First, what does a floating port look like? */ 201 /* First, what does a floating port look like? */
203 b = kmalloc(256, GFP_KERNEL); 202 b = kzalloc(256, GFP_KERNEL);
204 if (!b) { 203 if (!b) {
205 printk(KERN_ERR "do_io_probe: unable to kmalloc 256 bytes"); 204 printk(KERN_ERR "do_io_probe: unable to kmalloc 256 bytes");
206 return; 205 return;
207 } 206 }
208 memset(b, 0, 256);
209 for (i = base, most = 0; i < base+num; i += 8) { 207 for (i = base, most = 0; i < base+num; i += 8) {
210 res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA IO probe"); 208 res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA IO probe");
211 if (!res) 209 if (!res)
@@ -850,10 +848,9 @@ static int nonstatic_init(struct pcmcia_socket *s)
850{ 848{
851 struct socket_data *data; 849 struct socket_data *data;
852 850
853 data = kmalloc(sizeof(struct socket_data), GFP_KERNEL); 851 data = kzalloc(sizeof(struct socket_data), GFP_KERNEL);
854 if (!data) 852 if (!data)
855 return -ENOMEM; 853 return -ENOMEM;
856 memset(data, 0, sizeof(struct socket_data));
857 854
858 data->mem_db.next = &data->mem_db; 855 data->mem_db.next = &data->mem_db;
859 data->io_db.next = &data->io_db; 856 data->io_db.next = &data->io_db;