diff options
author | Joe Perches <joe@perches.com> | 2011-05-28 13:36:25 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 07:55:03 -0400 |
commit | 8e03bd6525d3281068519d5f6059cdcc5a67af66 (patch) | |
tree | 12e4cecbdef7eb38c8ff4406774008509a70fc47 /drivers/char | |
parent | 57f3224c3f838844cdae5e4a9d63e03152013f9a (diff) |
char: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/backend.c | 3 | ||||
-rw-r--r-- | drivers/char/raw.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index f27d0d0816d..4b71647782d 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c | |||
@@ -171,7 +171,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
171 | } | 171 | } |
172 | got_gatt = 1; | 172 | got_gatt = 1; |
173 | 173 | ||
174 | bridge->key_list = vmalloc(PAGE_SIZE * 4); | 174 | bridge->key_list = vzalloc(PAGE_SIZE * 4); |
175 | if (bridge->key_list == NULL) { | 175 | if (bridge->key_list == NULL) { |
176 | dev_err(&bridge->dev->dev, | 176 | dev_err(&bridge->dev->dev, |
177 | "can't allocate memory for key lists\n"); | 177 | "can't allocate memory for key lists\n"); |
@@ -181,7 +181,6 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
181 | got_keylist = 1; | 181 | got_keylist = 1; |
182 | 182 | ||
183 | /* FIXME vmalloc'd memory not guaranteed contiguous */ | 183 | /* FIXME vmalloc'd memory not guaranteed contiguous */ |
184 | memset(bridge->key_list, 0, PAGE_SIZE * 4); | ||
185 | 184 | ||
186 | if (bridge->driver->configure()) { | 185 | if (bridge->driver->configure()) { |
187 | dev_err(&bridge->dev->dev, "error configuring host chipset\n"); | 186 | dev_err(&bridge->dev->dev, "error configuring host chipset\n"); |
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index b33e8ea314e..b6de2c04714 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -324,13 +324,12 @@ static int __init raw_init(void) | |||
324 | max_raw_minors = MAX_RAW_MINORS; | 324 | max_raw_minors = MAX_RAW_MINORS; |
325 | } | 325 | } |
326 | 326 | ||
327 | raw_devices = vmalloc(sizeof(struct raw_device_data) * max_raw_minors); | 327 | raw_devices = vzalloc(sizeof(struct raw_device_data) * max_raw_minors); |
328 | if (!raw_devices) { | 328 | if (!raw_devices) { |
329 | printk(KERN_ERR "Not enough memory for raw device structures\n"); | 329 | printk(KERN_ERR "Not enough memory for raw device structures\n"); |
330 | ret = -ENOMEM; | 330 | ret = -ENOMEM; |
331 | goto error; | 331 | goto error; |
332 | } | 332 | } |
333 | memset(raw_devices, 0, sizeof(struct raw_device_data) * max_raw_minors); | ||
334 | 333 | ||
335 | ret = register_chrdev_region(dev, max_raw_minors, "raw"); | 334 | ret = register_chrdev_region(dev, max_raw_minors, "raw"); |
336 | if (ret) | 335 | if (ret) |