ACPI: platform: Use sizeof(*pointer) instead of sizeof(type)
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 31 Aug 2022 14:03:26 +0000 (17:03 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 3 Sep 2022 18:53:17 +0000 (20:53 +0200)
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>
drivers/acpi/acpi_platform.c

index 3a4d3d7772aa734d5b1b9dd95967116d40fa57f6..5e757b53476a30bb21dccb5e68e0b22ac3c16c10 100644 (file)
@@ -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);