Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3283120pxk; Mon, 5 Oct 2020 06:06:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1nySawOvILqO/JZGisRbFI27lPq7ChUktj2oRqPmuKrHgLZFw6A7RqprHId2z8a9fNtm7 X-Received: by 2002:a17:906:b2d1:: with SMTP id cf17mr15205363ejb.321.1601903212717; Mon, 05 Oct 2020 06:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601903212; cv=none; d=google.com; s=arc-20160816; b=lc55GtK1Ky3W0sLsgmoTtff7pqJ0Sz4Y7I9sVwbVh1rzVz7mpqQ/CQyKP0WlgKU8z7 3I7U9ckqkV5+vluulSEMCxCEhYXT9KW+WJxHtz9nzOFwKRgFIAODpzXHk5PL/FsSKicf EwUSc7QREPFc307tyRna52ntpf0SSCBb6riGLchinKS9N0qHxIm0GOI64U20W2qZYogu v8wCUjKw1lpXuJ1v6hlsb4Pyuue63zHVLlJkl2jwTaO1imQ63al2rUFnJctN8FlbSFUt Ck+wbnL8/1AH8xuKFUSEEjVErTEZzQMDtrFCXk83eknTPCBvgcpcsUhts3Aw4+/5GVut IjWg== 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; bh=UkykQLVlwQdqaI3Hs3odemFqx+/a7j9NgNl0K79DG0w=; b=quIOV+/7Ij2NVI1QAdM6KJeVSxEbq9m3NjrFmG0WA0rmi5Jh01Gr9e6eV488kXL/w1 xORItfo6DxQGnQ1O6hw8mjcYP4jj/PZhvtfNvgOnMsc7f59btZl7j7+HjMwG1R14N1Qf F2FVOBScpxiHXZPovn6R89GccUvro0BpVDJ/VEr+x7dx0aB1Ju4abZTxaeF+texD7iBA qPfgbwfscqxQF5gBJURniiLbPEV6BusInlpy3K6+k44t8II+YLckZDbCPQED2xRUKSTo AePJZgC7usCRB0RHeZzwSDIX1hP7vWvjeThoYwTcw/IaXAvNBKXV+vZcLw3VMjUkw+VX FKXg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bw3si7100940ejb.515.2020.10.05.06.06.28; Mon, 05 Oct 2020 06:06:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726447AbgJENC1 (ORCPT + 99 others); Mon, 5 Oct 2020 09:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbgJENBq (ORCPT ); Mon, 5 Oct 2020 09:01:46 -0400 Received: from smtp3.goneo.de (smtp3.goneo.de [IPv6:2001:1640:5::8:37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C73EEC0613BF for ; Mon, 5 Oct 2020 06:01:44 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.goneo.de (Postfix) with ESMTP id B09B5240289; Mon, 5 Oct 2020 15:01:43 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.954 X-Spam-Level: X-Spam-Status: No, score=-2.954 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.054, BAYES_00=-1.9] autolearn=ham Received: from smtp3.goneo.de ([127.0.0.1]) by localhost (smtp3.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xQijLWZfYp4Y; Mon, 5 Oct 2020 15:01:42 +0200 (CEST) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp3.goneo.de (Postfix) with ESMTPA id DE5AF2402A4; Mon, 5 Oct 2020 15:01:41 +0200 (CEST) From: poeschel@lemonage.de To: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel , Willy Tarreau Subject: [PATCH v4 25/32] auxdisplay: Call charlcd_backlight in place Date: Mon, 5 Oct 2020 15:01:21 +0200 Message-Id: <20201005130128.3430804-13-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201005130128.3430804-1-poeschel@lemonage.de> References: <20201005130128.3430804-1-poeschel@lemonage.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lars Poeschel This moves the call to charlcd_backlight from the end of the switch into the actual case statement that originates the change of the backlight. This is more consistent to what is now found in this switch. Reviewed-by: Willy Tarreau Signed-off-by: Lars Poeschel --- drivers/auxdisplay/charlcd.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index dca1b138a239..0f0568a4bd35 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -259,10 +259,16 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) break; case '+': /* Back light ON */ priv->flags |= LCD_FLAG_L; + if (priv->flags != oldflags) + charlcd_backlight(lcd, CHARLCD_ON); + processed = 1; break; case '-': /* Back light OFF */ priv->flags &= ~LCD_FLAG_L; + if (priv->flags != oldflags) + charlcd_backlight(lcd, CHARLCD_OFF); + processed = 1; break; case '*': /* Flash back light */ @@ -363,14 +369,6 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) break; } - /* TODO: This indent party here got ugly, clean it! */ - /* Check whether one flag was changed */ - if (oldflags == priv->flags) - return processed; - - if ((oldflags ^ priv->flags) & LCD_FLAG_L) - charlcd_backlight(lcd, !!(priv->flags & LCD_FLAG_L)); - return processed; } -- 2.28.0