Commit b272c059 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Rafael J. Wysocki

ACPI: sysfs: Unify pattern of memory allocations

Use the form of foo = kmalloc(sizeof(*foo)) everywhere in order to
unify pattern of memory allocations.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent d3121e64
...@@ -389,8 +389,7 @@ acpi_status acpi_sysfs_table_handler(u32 event, void *table, void *context) ...@@ -389,8 +389,7 @@ acpi_status acpi_sysfs_table_handler(u32 event, void *table, void *context)
switch (event) { switch (event) {
case ACPI_TABLE_EVENT_INSTALL: case ACPI_TABLE_EVENT_INSTALL:
table_attr = table_attr = kzalloc(sizeof(*table_attr), GFP_KERNEL);
kzalloc(sizeof(struct acpi_table_attr), GFP_KERNEL);
if (!table_attr) if (!table_attr)
return AE_NO_MEMORY; return AE_NO_MEMORY;
...@@ -842,13 +841,11 @@ void acpi_irq_stats_init(void) ...@@ -842,13 +841,11 @@ void acpi_irq_stats_init(void)
num_gpes = acpi_current_gpe_count; num_gpes = acpi_current_gpe_count;
num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA; num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA;
all_attrs = kcalloc(num_counters + 1, sizeof(struct attribute *), all_attrs = kcalloc(num_counters + 1, sizeof(*all_attrs), GFP_KERNEL);
GFP_KERNEL);
if (all_attrs == NULL) if (all_attrs == NULL)
return; return;
all_counters = kcalloc(num_counters, sizeof(struct event_counter), all_counters = kcalloc(num_counters, sizeof(*all_counters), GFP_KERNEL);
GFP_KERNEL);
if (all_counters == NULL) if (all_counters == NULL)
goto fail; goto fail;
...@@ -856,8 +853,7 @@ void acpi_irq_stats_init(void) ...@@ -856,8 +853,7 @@ void acpi_irq_stats_init(void)
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
goto fail; goto fail;
counter_attrs = kcalloc(num_counters, sizeof(struct kobj_attribute), counter_attrs = kcalloc(num_counters, sizeof(*counter_attrs), GFP_KERNEL);
GFP_KERNEL);
if (counter_attrs == NULL) if (counter_attrs == NULL)
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment