Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3249372pxk; Mon, 5 Oct 2020 05:15:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM9ZtiB6PJD86HgwtgXQIZ0f0Q3LumOhymGDalA43HFtBQtlbx8vxIogd6fxCE6qF0EVUJ X-Received: by 2002:a50:9e49:: with SMTP id z67mr5564259ede.183.1601900136056; Mon, 05 Oct 2020 05:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601900136; cv=none; d=google.com; s=arc-20160816; b=eHuRIflEVG/5T7/zicLytPtvx1LpUujCD0zJCq7HjqDGB6oosdJYe2a3unqycyDKSX hhKZSJFp5xdyMBqIY1tfvqu3jgnp0dtYhyih40GYceJDA2aDR1UC6AKuWsPe2fFCK0BH NXRBoBNQmRQAKYx+xLAj1tEJkmphLza3gk9KsNMldTGggkqhEd8UySMG82Vu1JVDlxfB 8v0bPG/H6BW5BeXFUlng/MvX/L/Y4uGQ/y/mdtxqKlyyw904dEuVKkjQxDhQIoB/aRxn qlaS1XPHE3CiZ4JNywRU2ibcu876ZYHpgbBVB0E5dVCKJPbgmw6gs8zbfWGtvI9W/x3B EZpg== 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=iYvYyVWbkkNDZOk16Kgc5npS7M+9TuFcJ01i6bjeXw5GxkPvxODWQjuC773ofdIWah 9vnFpiTb+RGOTgWfRXrEzN0gbsgpdqkLwqxY5ZybndlgT594Gz9fe43zAv2HeHT9VV0V tMW4Bd6ORvnb2zsf11sFRarEHmg0hyDS2O6wk7viM86lKLiZUXoyBcnoVrojZ3rRdNqb TiYldFHMUg3OU9DcPkoqWPiM8Q31C55otXk6Epvu3DC1T21sJa6A0l39sZi3n+eib4EA Zfx0U9z0Q8ekxsbx2X2BOCngeOydGa2geEAItGL6Er07zRlDoTKksIv5hvXvObkjU2LY 1TnQ== 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 m8si159567eji.741.2020.10.05.05.15.13; Mon, 05 Oct 2020 05:15:36 -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 S1726667AbgJEMNa (ORCPT + 99 others); Mon, 5 Oct 2020 08:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbgJEMMi (ORCPT ); Mon, 5 Oct 2020 08:12:38 -0400 Received: from smtp2-2.goneo.de (smtp2.goneo.de [IPv6:2001:1640:5::8:33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99495C0613AB for ; Mon, 5 Oct 2020 05:12:37 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.goneo.de (Postfix) with ESMTP id 72348241DDF; Mon, 5 Oct 2020 14:12:36 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.984 X-Spam-Level: X-Spam-Status: No, score=-2.984 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.084, BAYES_00=-1.9] autolearn=ham Received: from smtp2.goneo.de ([127.0.0.1]) by localhost (smtp2.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TpuiyQa_eELt; Mon, 5 Oct 2020 14:12:35 +0200 (CEST) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp2.goneo.de (Postfix) with ESMTPA id E9F4B24125F; Mon, 5 Oct 2020 14:12:34 +0200 (CEST) From: poeschel@lemonage.de To: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel , Willy Tarreau Subject: [PATCH v3 25/32] auxdisplay: Call charlcd_backlight in place Date: Mon, 5 Oct 2020 14:11:53 +0200 Message-Id: <20201005121200.3427363-26-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201005121200.3427363-1-poeschel@lemonage.de> References: <20201005121200.3427363-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