From: David Lechner Date: Fri, 16 Sep 2016 19:16:49 +0000 (-0500) Subject: leds: Use macro for max device node name size X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb1ce7469940b4eb8a466d9ae4d032fb2c9969dc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git leds: Use macro for max device node name size Use a macro instead of hard-coding the max device node name size. The uleds driver introduced a macro for this value, so using it. Signed-off-by: David Lechner Signed-off-by: Jacek Anaszewski --- diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index aa84e5b37593..d946eb166781 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "leds.h" static struct class *leds_class; @@ -187,7 +188,7 @@ static int led_classdev_next_name(const char *init_name, char *name, */ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) { - char name[64]; + char name[LED_MAX_NAME_SIZE]; int ret; ret = led_classdev_next_name(led_cdev->name, name, sizeof(name));