gpio-button-hotplug: use flexible array member
authorRosen Penev <rosenp@gmail.com>
Fri, 2 Aug 2024 21:30:32 +0000 (14:30 -0700)
committerRobert Marko <robimarko@gmail.com>
Mon, 4 Nov 2024 09:50:44 +0000 (10:50 +0100)
zero length arrays are deprecated.

Fixes coccinelle warning:

WARNING use flexible-array member instead

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16848
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c

index 1dd0ff2a1a1abf09be4fd279771c2749c1e0c47e..52346c25d98a3ce8df626f13f7da335a1d300528 100644 (file)
@@ -302,7 +302,7 @@ struct gpio_keys_button_dev {
 
        struct device *dev;
        struct gpio_keys_platform_data *pdata;
-       struct gpio_keys_button_data data[0];
+       struct gpio_keys_button_data data[];
 };
 
 static void gpio_keys_polled_queue_work(struct gpio_keys_button_dev *bdev)