diff mbox series

[leds,v2,12/50] leds: bcm6328: cosmetic: use reverse christmas tree

Message ID 20200917223338.14164-13-marek.behun@nic.cz
State New
Headers show
Series None | expand

Commit Message

Marek Behún Sept. 17, 2020, 10:33 p.m. UTC
Only a cosmetic change: use reverse christmas tree variables
declaration.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Álvaro Fernández Rojas <noltari@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Jaedon Shin <jaedon.shin@gmail.com>
---
 drivers/leds/leds-bcm6328.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Comments

Pavel Machek Sept. 19, 2020, 9:18 a.m. UTC | #1
On Fri 2020-09-18 00:33:00, Marek Behún wrote:
> Only a cosmetic change: use reverse christmas tree variables

> declaration.


Yeah. Don't do that. Code changes for no reason.
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
diff mbox series

Patch

diff --git a/drivers/leds/leds-bcm6328.c b/drivers/leds/leds-bcm6328.c
index c72b0842e8151..38bf820372528 100644
--- a/drivers/leds/leds-bcm6328.c
+++ b/drivers/leds/leds-bcm6328.c
@@ -109,8 +109,8 @@  static unsigned long bcm6328_pin2shift(unsigned long pin)
 
 static void bcm6328_led_mode(struct bcm6328_led *led, unsigned long value)
 {
-	void __iomem *mode;
 	unsigned long val, shift;
+	void __iomem *mode;
 
 	shift = bcm6328_pin2shift(led->pin);
 	if (shift / 16)
@@ -255,8 +255,8 @@  static int bcm6328_blink_set(struct led_classdev *led_cdev,
 static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg,
 			 void __iomem *mem, spinlock_t *lock)
 {
-	int i, cnt;
 	unsigned long flags, val;
+	int i, cnt;
 
 	spin_lock_irqsave(lock, flags);
 	val = bcm6328_led_read(mem + BCM6328_REG_HWDIS);
@@ -271,8 +271,8 @@  static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg,
 	cnt = of_property_count_elems_of_size(nc, "brcm,link-signal-sources",
 					      sizeof(u32));
 	for (i = 0; i < cnt; i++) {
-		u32 sel;
 		void __iomem *addr;
+		u32 sel;
 
 		if (reg < 4)
 			addr = mem + BCM6328_REG_LNKACTSEL_LO;
@@ -298,8 +298,8 @@  static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg,
 					      "brcm,activity-signal-sources",
 					      sizeof(u32));
 	for (i = 0; i < cnt; i++) {
-		u32 sel;
 		void __iomem *addr;
+		u32 sel;
 
 		if (reg < 4)
 			addr = mem + BCM6328_REG_LNKACTSEL_LO;
@@ -395,12 +395,11 @@  static int bcm6328_led(struct device *dev, struct device_node *nc, u32 reg,
 
 static int bcm6328_leds_probe(struct platform_device *pdev)
 {
+	unsigned long val, *blink_leds, *blink_delay;
 	struct device *dev = &pdev->dev;
-	struct device_node *np = dev_of_node(&pdev->dev);
-	struct device_node *child;
+	struct device_node *np, *child;
 	void __iomem *mem;
 	spinlock_t *lock; /* memory lock */
-	unsigned long val, *blink_leds, *blink_delay;
 
 	mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mem))
@@ -426,6 +425,8 @@  static int bcm6328_leds_probe(struct platform_device *pdev)
 	bcm6328_led_write(mem + BCM6328_REG_LNKACTSEL_HI, 0);
 	bcm6328_led_write(mem + BCM6328_REG_LNKACTSEL_LO, 0);
 
+	np = dev_of_node(dev);
+
 	val = bcm6328_led_read(mem + BCM6328_REG_INIT);
 	val &= ~(BCM6328_INIT_MASK);
 	if (of_property_read_bool(np, "brcm,serial-leds"))
@@ -441,8 +442,8 @@  static int bcm6328_leds_probe(struct platform_device *pdev)
 	bcm6328_led_write(mem + BCM6328_REG_INIT, val);
 
 	for_each_available_child_of_node(np, child) {
-		int rc;
 		u32 reg;
+		int rc;
 
 		if (of_property_read_u32(child, "reg", &reg))
 			continue;