Skip to content

Commit 8e03bd6

Browse files
JoePerchesJiri Kosina
authored andcommitted
char: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 57f3224 commit 8e03bd6

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/char/agp/backend.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
171171
}
172172
got_gatt = 1;
173173

174-
bridge->key_list = vmalloc(PAGE_SIZE * 4);
174+
bridge->key_list = vzalloc(PAGE_SIZE * 4);
175175
if (bridge->key_list == NULL) {
176176
dev_err(&bridge->dev->dev,
177177
"can't allocate memory for key lists\n");
@@ -181,7 +181,6 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
181181
got_keylist = 1;
182182

183183
/* FIXME vmalloc'd memory not guaranteed contiguous */
184-
memset(bridge->key_list, 0, PAGE_SIZE * 4);
185184

186185
if (bridge->driver->configure()) {
187186
dev_err(&bridge->dev->dev, "error configuring host chipset\n");

‎drivers/char/raw.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,12 @@ static int __init raw_init(void)
324324
max_raw_minors = MAX_RAW_MINORS;
325325
}
326326

327-
raw_devices = vmalloc(sizeof(struct raw_device_data) * max_raw_minors);
327+
raw_devices = vzalloc(sizeof(struct raw_device_data) * max_raw_minors);
328328
if (!raw_devices) {
329329
printk(KERN_ERR "Not enough memory for raw device structures\n");
330330
ret = -ENOMEM;
331331
goto error;
332332
}
333-
memset(raw_devices, 0, sizeof(struct raw_device_data) * max_raw_minors);
334333

335334
ret = register_chrdev_region(dev, max_raw_minors, "raw");
336335
if (ret)

0 commit comments

Comments
 (0)