lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 Sep 2020 00:33:35 +0200
From:   Marek Behún <marek.behun@....cz>
To:     linux-leds@...r.kernel.org
Cc:     Pavel Machek <pavel@....cz>, Dan Murphy <dmurphy@...com>,
        Ondřej Jirman <megous@...ous.com>,
        linux-kernel@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
        devicetree@...r.kernel.org,
        Marek Behún <marek.behun@....cz>,
        Simon Guinot <simon.guinot@...uanux.org>,
        Simon Guinot <sguinot@...ie.com>,
        Vincent Donnefort <vdonnefort@...il.com>,
        Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH leds v2 47/50] leds: ns2: cosmetic: use reverse christmas tree

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

Signed-off-by: Marek Behún <marek.behun@....cz>
Cc: Simon Guinot <simon.guinot@...uanux.org>
Cc: Simon Guinot <sguinot@...ie.com>
Cc: Vincent Donnefort <vdonnefort@...il.com>
Cc: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
Cc: Linus Walleij <linus.walleij@...aro.org>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ