Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp753633pxk; Thu, 17 Sep 2020 15:36:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQZrN5W2lVxcniZRWNYMpEt3HwAh40GMGcfWggo9800kGBnsJYrfvI2ZDJZID+YIZvB6KI X-Received: by 2002:a05:6402:2c7:: with SMTP id b7mr36445947edx.125.1600382176781; Thu, 17 Sep 2020 15:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600382176; cv=none; d=google.com; s=arc-20160816; b=sfSdMu2n44tGC0WGmcNk40EA7srjUK6//OQPIzkSsc4nNtZEU2NXxttee7dvLoiOGw f5W+M97ZecCigpA9JNzkCDLEIjSvjZv3AAwVXuZRcQ0k8kFvJhOwvNpT58K+2yA5ULw5 MEtUQkUaFN81Wny+Fe7uSK2PNb8LSiNKOCnAYU5BoRavTFyyiAo8eGMWTZWgH3I3qydS HwDaHw7i1YrqyQhzX7tLQRdOyptmrs3fMsHuYRN/EMGJwhOAMUzLt6LU0hADDlLGkdYp /sy9UBXrSEpevQR1VT1odT3kQcQgqYqdCaaBCqcrBMXex9gAX9ggwmHfB/AMATvcEFl/ ivYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EgVApPEJQgjKJMh0SoWT6a/lH5BI+wgCSEECKMmzo/I=; b=JFxN/N8MT8HnC1pBrp1e/bmhxhRlWylkAJXOAZ/iKj2FNOOh2+RtZM3bbCCWpGpO+6 ompiswEauMjxSkQO3fu4im8WTbIvx7N8MmJ28bepvj0FoZxtz6Q4LlSaUGGBLcZh951b bhpB2YUT2OpJ7fq/k4oZxsb0dLeVc1zyR3yukN10Jtn0ljx2DCHzFu1LxUSfXvDWnZ2i FCXoMCWDZtErpg0RzEJFxLT/NoSZaTTiWU1FzqU/w/wguulYeRj9o1b1OcRb14xVL999 O/6/jOux1zlPeKWCy9WWyC0pFICU5ZNLd8vjz1boumQ3k1GLgfhj3uAZFA4NIPKKP6yW OHSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nic.cz header.s=default header.b=bZ19GVVC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si954343edc.164.2020.09.17.15.35.53; Thu, 17 Sep 2020 15:36:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nic.cz header.s=default header.b=bZ19GVVC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726534AbgIQWeh (ORCPT + 99 others); Thu, 17 Sep 2020 18:34:37 -0400 Received: from mail.nic.cz ([217.31.204.67]:35700 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726338AbgIQWeS (ORCPT ); Thu, 17 Sep 2020 18:34:18 -0400 Received: from dellmb.labs.office.nic.cz (unknown [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463]) by mail.nic.cz (Postfix) with ESMTP id 3675414206C; Fri, 18 Sep 2020 00:34:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1600382042; bh=E+ZKKlISSwDQf/4ZiNjvyLvW12BvjFajZwQ6LoiY+JE=; h=From:To:Date; b=bZ19GVVCbIEI75Z/bxdlit47JBgBBfNr2aPy6Y/N8k4nDzjA4weJfaHTTZRk4YRDA szuGCMu52h1PpTtP0RJrjkZQiFhX1GWzroHsNpJ7VjwwZnr/mYIfrnK0EC3+N6QWdT 75J8thrYcEbyEbOFMz82E5p+KimKFsRKYqZZtRxM= From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: linux-leds@vger.kernel.org Cc: Pavel Machek , Dan Murphy , =?UTF-8?q?Ond=C5=99ej=20Jirman?= , linux-kernel@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= , Simon Guinot , Simon Guinot , Vincent Donnefort , Thomas Petazzoni , Linus Walleij Subject: [PATCH leds v2 47/50] leds: ns2: cosmetic: use reverse christmas tree Date: Fri, 18 Sep 2020 00:33:35 +0200 Message-Id: <20200917223338.14164-48-marek.behun@nic.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200917223338.14164-1-marek.behun@nic.cz> References: <20200917223338.14164-1-marek.behun@nic.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Spam-Status: No, score=0.00 X-Spamd-Bar: / X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only a cosmetic change: use reverse christmas tree variables declaration. Signed-off-by: Marek BehĂșn Cc: Simon Guinot Cc: Simon Guinot Cc: Vincent Donnefort Cc: Thomas Petazzoni Cc: Linus Walleij --- 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