Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

w1: gpio: 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 <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>

authored by

Andy Shevchenko and committed by
Krzysztof Kozlowski
ef2b810e 9e085c04

+1 -2
+1 -2
drivers/w1/masters/w1-gpio.c
··· 85 85 if (device_property_present(dev, "linux,open-drain")) 86 86 gflags = GPIOD_OUT_LOW; 87 87 88 - master = devm_kzalloc(dev, sizeof(struct w1_bus_master), 89 - GFP_KERNEL); 88 + master = devm_kzalloc(dev, sizeof(*master), GFP_KERNEL); 90 89 if (!master) 91 90 return -ENOMEM; 92 91