Skip to content

Commit 895a4d6

Browse files
andy-shevrafaeljw
authored andcommitted
ACPI: platform: Use sizeof(*pointer) instead of sizeof(type)
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 1d19014 commit 895a4d6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/acpi/acpi_platform.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
116116
if (count < 0)
117117
return NULL;
118118
if (count > 0) {
119-
resources = kcalloc(count, sizeof(struct resource),
120-
GFP_KERNEL);
119+
resources = kcalloc(count, sizeof(*resources), GFP_KERNEL);
121120
if (!resources) {
122121
acpi_dev_free_resource_list(&resource_list);
123122
return ERR_PTR(-ENOMEM);

0 commit comments

Comments
 (0)