]> www.infradead.org Git - users/hch/uuid.git/commitdiff
thermal: int3400: Use sizeof(*pointer) instead of sizeof(type)
authorErick Archer <erick.archer@outlook.com>
Thu, 6 Jun 2024 17:21:06 +0000 (19:21 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 7 Jun 2024 18:59:33 +0000 (20:59 +0200)
It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/intel/int340x_thermal/int3400_thermal.c

index fa96972266e4b0486e4c5ec5463e4eab9deced24..b0c0f0ffdcb046607b4478390f39a77ae316a511 100644 (file)
@@ -571,7 +571,7 @@ static int int3400_thermal_probe(struct platform_device *pdev)
        if (!adev)
                return -ENODEV;
 
-       priv = kzalloc(sizeof(struct int3400_thermal_priv), GFP_KERNEL);
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;