From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] leds: core: fix formatting issues
Date: Wed, 11 Mar 2026 18:43:28 -0700 [thread overview]
Message-ID: <20260311-led-swnode-name-v1-2-798a49e041c6@gmail.com> (raw)
In-Reply-To: <20260311-led-swnode-name-v1-0-798a49e041c6@gmail.com>
Fix formatting issues reported by checkpatch.pl, such as extra empty
lines, lack of braces on some branches, and misaligned function
arguments.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/leds/led-core.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 8ce41b36c645..385e78af1dac 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -85,7 +85,7 @@ static void led_timer_function(struct timer_list *t)
if (!brightness) {
/* Time to switch the LED on. */
if (test_and_clear_bit(LED_BLINK_BRIGHTNESS_CHANGE,
- &led_cdev->work_flags))
+ &led_cdev->work_flags))
brightness = led_cdev->new_blink_brightness;
else
brightness = led_cdev->blink_brightness;
@@ -217,10 +217,9 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
mod_timer(&led_cdev->blink_timer, jiffies + 1);
}
-
static void led_blink_setup(struct led_classdev *led_cdev,
- unsigned long *delay_on,
- unsigned long *delay_off)
+ unsigned long *delay_on,
+ unsigned long *delay_off)
{
if (!test_bit(LED_BLINK_ONESHOT, &led_cdev->work_flags) &&
led_cdev->blink_set &&
@@ -262,7 +261,7 @@ void led_blink_set_oneshot(struct led_classdev *led_cdev,
int invert)
{
if (test_bit(LED_BLINK_ONESHOT, &led_cdev->work_flags) &&
- timer_pending(&led_cdev->blink_timer))
+ timer_pending(&led_cdev->blink_timer))
return;
set_bit(LED_BLINK_ONESHOT, &led_cdev->work_flags);
@@ -347,9 +346,9 @@ void led_set_brightness_nopm(struct led_classdev *led_cdev, unsigned int value)
/* Ensure delayed_set_value is seen before work_flags modification */
smp_mb__before_atomic();
- if (value)
+ if (value) {
set_bit(LED_SET_BRIGHTNESS, &led_cdev->work_flags);
- else {
+ } else {
clear_bit(LED_SET_BRIGHTNESS, &led_cdev->work_flags);
clear_bit(LED_SET_BLINK, &led_cdev->work_flags);
set_bit(LED_SET_BRIGHTNESS_OFF, &led_cdev->work_flags);
@@ -499,7 +498,6 @@ static void led_parse_fwnode_props(struct device *dev,
props->color_present = true;
}
-
if (!fwnode_property_present(fwnode, "function"))
return;
@@ -584,8 +582,9 @@ int led_compose_name(struct device *dev, struct led_init_data *init_data,
} else if (is_software_node(fwnode)) {
n = snprintf(led_classdev_name, LED_MAX_NAME_SIZE, "%s",
fwnode_get_name(fwnode));
- } else
+ } else {
return -EINVAL;
+ }
if (n >= LED_MAX_NAME_SIZE)
return -E2BIG;
--
2.53.0.473.g4a7958ca14-goog
next prev parent reply other threads:[~2026-03-12 1:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 1:43 [PATCH 0/2] Fall back to using software node name as LED name Dmitry Torokhov
2026-03-12 1:43 ` [PATCH 1/2] leds: core: implement fallback to software node name for LED names Dmitry Torokhov
2026-03-12 1:43 ` Dmitry Torokhov [this message]
2026-03-26 9:32 ` (subset) [PATCH 2/2] leds: core: fix formatting issues Lee Jones
2026-03-25 13:38 ` [PATCH 0/2] Fall back to using software node name as LED name Lee Jones
2026-03-25 16:07 ` Dmitry Torokhov
2026-03-26 9:32 ` Lee Jones
2026-03-26 9:32 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260311-led-swnode-name-v1-2-798a49e041c6@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®