Only a cosmetic change: use reverse christmas tree variables
declaration.

Signed-off-by: Marek Behún <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Vincent Donnefort <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Linus Walleij <[email protected]>
---
 drivers/leds/leds-ns2.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c
index e94bb8535f0a7..40f36c53d9e87 100644
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@ -50,9 +50,9 @@ struct ns2_led {
 
 static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode)
 {
-       int i;
-       int cmd_level;
        int slow_level;
+       int cmd_level;
+       int i;
 
        cmd_level = gpiod_get_value_cansleep(led->cmd);
        slow_level = gpiod_get_value_cansleep(led->slow);
@@ -70,8 +70,8 @@ static int ns2_led_get_mode(struct ns2_led *led, enum 
ns2_led_modes *mode)
 
 static void ns2_led_set_mode(struct ns2_led *led, enum ns2_led_modes mode)
 {
-       int i;
        unsigned long flags;
+       int i;
 
        for (i = 0; i < led->num_modes; i++)
                if (mode == led->modval[i].mode)
@@ -123,9 +123,11 @@ static ssize_t ns2_led_sata_store(struct device *dev,
                                  const char *buff, size_t count)
 {
        struct led_classdev *led_cdev = dev_get_drvdata(dev);
-       struct ns2_led *led = container_of(led_cdev, struct ns2_led, cdev);
-       int ret;
        unsigned long enable;
+       struct ns2_led *led;
+       int ret;
+
+       led = container_of(led_cdev, struct ns2_led, cdev);
 
        ret = kstrtoul(buff, 10, &enable);
        if (ret < 0)
@@ -154,7 +156,9 @@ static ssize_t ns2_led_sata_show(struct device *dev,
                                 struct device_attribute *attr, char *buf)
 {
        struct led_classdev *led_cdev = dev_get_drvdata(dev);
-       struct ns2_led *led = container_of(led_cdev, struct ns2_led, cdev);
+       struct ns2_led *led;
+
+       led = container_of(led_cdev, struct ns2_led, cdev);
 
        return sprintf(buf, "%d\n", led->sata);
 }
-- 
2.26.2

Reply via email to