w1: gpio: Use sizeof(*pointer) instead of sizeof(type)
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 7 Mar 2024 14:35:49 +0000 (16:35 +0200)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 25 Mar 2024 11:06:37 +0000 (12:06 +0100)
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>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20240307143644.3787260-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/w1/masters/w1-gpio.c

index a5ac34b32f544926dfeedbffcacca8b7061998e9..3881f2eaed2f5ae8932a75a7806ba3443f59fcbb 100644 (file)
@@ -85,8 +85,7 @@ static int w1_gpio_probe(struct platform_device *pdev)
        if (device_property_present(dev, "linux,open-drain"))
                gflags = GPIOD_OUT_LOW;
 
-       master = devm_kzalloc(dev, sizeof(struct w1_bus_master),
-                       GFP_KERNEL);
+       master = devm_kzalloc(dev, sizeof(*master), GFP_KERNEL);
        if (!master)
                return -ENOMEM;