Skip to content

Commit

Permalink
ACPI: platform: Use sizeof(*pointer) instead of sizeof(type)
Browse files Browse the repository at this point in the history
It is preferred to use sizeof(*pointer) instead of sizeof(type).
The type of the variable can change and one needs not change
the former (unlike the latter). No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Andy Shevchenko authored and Rafael J. Wysocki committed Sep 3, 2022
1 parent 1d19014 commit 895a4d6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/acpi/acpi_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
if (count < 0)
return NULL;
if (count > 0) {
resources = kcalloc(count, sizeof(struct resource),
GFP_KERNEL);
resources = kcalloc(count, sizeof(*resources), GFP_KERNEL);
if (!resources) {
acpi_dev_free_resource_list(&resource_list);
return ERR_PTR(-ENOMEM);
Expand Down

0 comments on commit 895a4d6

Please sign in to comment.