summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorDeepak Saxena <dsaxena@plexity.net>2005-11-07 01:01:24 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 07:54:00 -0800
commit9c2153844d72ac92b6da0ee42f7f81fb0aa91f8a (patch)
tree77da7b9ea21ae365273973a20c1cec349c570f22 /drivers/firmware
parent49d0c6039dd36791cad36624e68bce5fe011bf12 (diff)
downloadop-kernel-dev-9c2153844d72ac92b6da0ee42f7f81fb0aa91f8a.zip
op-kernel-dev-9c2153844d72ac92b6da0ee42f7f81fb0aa91f8a.tar.gz
[PATCH] drivers/firmware: kmalloc + memset -> kzalloc conversion
Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/edd.c3
-rw-r--r--drivers/firmware/efivars.c10
2 files changed, 4 insertions, 9 deletions
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 6996476..b4502ed6 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -715,7 +715,6 @@ edd_device_register(struct edd_device *edev, int i)
if (!edev)
return 1;
- memset(edev, 0, sizeof (*edev));
edd_dev_set_info(edev, i);
kobject_set_name(&edev->kobj, "int13_dev%02x",
0x80 + i);
@@ -756,7 +755,7 @@ edd_init(void)
return rc;
for (i = 0; i < edd_num_devices() && !rc; i++) {
- edev = kmalloc(sizeof (*edev), GFP_KERNEL);
+ edev = kzalloc(sizeof (*edev), GFP_KERNEL);
if (!edev)
return -ENOMEM;
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 33b17c6..bda5bce 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -614,16 +614,14 @@ efivar_create_sysfs_entry(unsigned long variable_name_size,
char *short_name;
struct efivar_entry *new_efivar;
- short_name = kmalloc(short_name_size + 1, GFP_KERNEL);
- new_efivar = kmalloc(sizeof(struct efivar_entry), GFP_KERNEL);
+ short_name = kzalloc(short_name_size + 1, GFP_KERNEL);
+ new_efivar = kzalloc(sizeof(struct efivar_entry), GFP_KERNEL);
if (!short_name || !new_efivar) {
kfree(short_name);
kfree(new_efivar);
return 1;
}
- memset(short_name, 0, short_name_size+1);
- memset(new_efivar, 0, sizeof(struct efivar_entry));
memcpy(new_efivar->var.VariableName, variable_name,
variable_name_size);
@@ -674,14 +672,12 @@ efivars_init(void)
if (!efi_enabled)
return -ENODEV;
- variable_name = kmalloc(variable_name_size, GFP_KERNEL);
+ variable_name = kzalloc(variable_name_size, GFP_KERNEL);
if (!variable_name) {
printk(KERN_ERR "efivars: Memory allocation failed.\n");
return -ENOMEM;
}
- memset(variable_name, 0, variable_name_size);
-
printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION,
EFIVARS_DATE);
OpenPOWER on IntegriCloud