linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <marek.behun@nic.cz>
To: linux-leds@vger.kernel.org
Cc: "Pavel Machek" <pavel@ucw.cz>, "Dan Murphy" <dmurphy@ti.com>,
	"Ondřej Jirman" <megous@megous.com>,
	linux-kernel@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, "Marek Behún" <marek.behun@nic.cz>,
	"Simon Guinot" <simon.guinot@sequanux.org>,
	"Simon Guinot" <sguinot@lacie.com>,
	"Vincent Donnefort" <vdonnefort@gmail.com>,
	"Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
	"Linus Walleij" <linus.walleij@linaro.org>
Subject: [PATCH leds v2 47/50] leds: ns2: cosmetic: use reverse christmas tree
Date: Fri, 18 Sep 2020 00:33:35 +0200	[thread overview]
Message-ID: <20200917223338.14164-48-marek.behun@nic.cz> (raw)
In-Reply-To: <20200917223338.14164-1-marek.behun@nic.cz>

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

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Simon Guinot <simon.guinot@sequanux.org>
Cc: Simon Guinot <sguinot@lacie.com>
Cc: Vincent Donnefort <vdonnefort@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Linus Walleij <linus.walleij@linaro.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


  parent reply	other threads:[~2020-09-17 22:34 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 22:32 [PATCH leds v2 00/50] Start moving parsing of `linux,default-trigger` to LED core (a cleanup of LED drivers) Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 01/50] leds: various: compile if COMPILE_TEST=y Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 02/50] leds: ip30: " Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 03/50] leds: fsg: " Marek Behún
2020-09-19  9:56   ` Pavel Machek
2020-09-19 15:54     ` Marek Behun
2020-09-17 22:32 ` [PATCH leds v2 04/50] leds: various: use device_get_match_data Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 05/50] leds: various: guard of_match_table member value with of_match_ptr Marek Behún
2020-09-18  6:15   ` Sakari Ailus
2020-09-18  9:20     ` Marek Behun
2020-09-18  9:57       ` Sakari Ailus
2020-09-18 10:10         ` Marek Behun
2020-09-28  8:03         ` Lee Jones
2020-09-28  8:11           ` Lee Jones
2020-09-28  9:37             ` Sakari Ailus
2020-09-17 22:32 ` [PATCH leds v2 06/50] leds: various: use dev_of_node(dev) instead of dev->of_node Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 07/50] leds: lt3593: do not rewrite .of_node of new LED device to wrong value Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 08/50] leds: various: use only available OF children Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 09/50] leds: various: fix OF node leaks Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 10/50] leds: bcm6328, bcm6358: use devres LED registering function Marek Behún
2020-09-17 22:32 ` [PATCH leds v2 11/50] leds: bcm6328, bcm6358: use struct led_init_data when registering Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 12/50] leds: bcm6328: cosmetic: use reverse christmas tree Marek Behún
2020-09-19  9:18   ` Pavel Machek
2020-09-17 22:33 ` [PATCH leds v2 13/50] leds: bcm6358: " Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 14/50] leds: lm3697: use struct led_init_data when registering Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 15/50] leds: lm3697: cosmetic change: use helper variable, reverse christmas tree Marek Behún
2020-09-18 11:47   ` Dan Murphy
2020-09-18 17:22     ` Marek Behun
2020-09-17 22:33 ` [PATCH leds v2 16/50] leds: max77650: use struct led_init_data when registering Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 17/50] leds: max77650: use reverse christmas tree Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 18/50] leds: mt6323: use struct led_init_data when registering Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 19/50] leds: mt6323: cosmetic change: use helper variable Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 20/50] leds: pm8058: use struct led_init_data when registering Marek Behún
2020-09-29 13:14   ` Linus Walleij
2020-09-17 22:33 ` [PATCH leds v2 21/50] leds: pm8058: cosmetic change: use helper variable Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 22/50] leds: pm8058: cosmetic change: no need to return in if guard Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 23/50] leds: pm8058: cosmetic: use reverse christmas tree Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 24/50] leds: is31fl32xx: use struct led_init_data when registering Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 25/50] leds: is31fl319x: compute aggregated max current separately Marek Behún
2020-09-19 10:20   ` Pavel Machek
2020-09-17 22:33 ` [PATCH leds v2 26/50] leds: is31fl319x: don't store shutdown gpio descriptor Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 27/50] leds: is31fl319x: don't store audio gain value, simply set it Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 28/50] leds: is31fl319x: refactor to register LEDs while parsing DT Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 29/50] leds: is31fl319x: cosmetic: use reverse christmas tree Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 30/50] leds: is31fl319x: use struct led_init_data when registering Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 31/50] leds: lm36274: use devres LED registering function Marek Behún
2020-09-19 10:04   ` Pavel Machek
2020-09-17 22:33 ` [PATCH leds v2 32/50] leds: lm36274: cosmetic: rename lm36274_data to chip Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 33/50] leds: lm36274: don't iterate through children since there is only one Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 34/50] leds: lm36274: use struct led_init_data when registering Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 35/50] leds: lm36274: do not set chip settings in DT parsing function Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 36/50] leds: ns2: use devres LED registering function Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 37/50] leds: ns2: alloc simple array instead of struct ns2_led_priv Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 38/50] leds: ns2: support OF probing only, forget platdata Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 39/50] leds: ns2: move parsing of one LED into separate function Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 40/50] leds: ns2: use devres API for getting GPIO descriptors Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 41/50] leds: ns2: cosmetic structure rename Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 42/50] leds: ns2: cosmetic variable rename Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 43/50] leds: ns2: cosmetic change Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 44/50] leds: ns2: cosmetic change: use helper variable Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 45/50] leds: ns2: register LED immediately after parsing DT properties Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 46/50] leds: ns2: remove unneeded variable Marek Behún
2020-09-17 22:33 ` Marek Behún [this message]
2020-09-17 22:33 ` [PATCH leds v2 48/50] leds: ns2: reorder headers alphabetically Marek Behún
2020-09-19 10:12   ` Pavel Machek
2020-09-17 22:33 ` [PATCH leds v2 49/50] leds: ns2: use struct led_init_data when registering Marek Behún
2020-09-17 22:33 ` [PATCH leds v2 50/50] leds: parse linux,default-trigger DT property in LED core Marek Behún
2020-09-19 10:19   ` Pavel Machek
2020-09-22 17:32 ` [PATCH leds v2 00/50] Start moving parsing of `linux,default-trigger` to LED core (a cleanup of LED drivers) Simon Guinot
2020-09-26 13:47 ` Simon Guinot

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=20200917223338.14164-48-marek.behun@nic.cz \
    --to=marek.behun@nic.cz \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=megous@megous.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=sguinot@lacie.com \
    --cc=simon.guinot@sequanux.org \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=vdonnefort@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).