Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3206553pxk; Mon, 21 Sep 2020 07:52:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfV1Ty0J12AE3Jyfs9Lbsxnr8kpsrvr/BQx8xmt6lh5v9Qu0ofGRQCFxFu3kUtUz9yIQoj X-Received: by 2002:a17:906:b74a:: with SMTP id fx10mr49111787ejb.232.1600699966324; Mon, 21 Sep 2020 07:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699966; cv=none; d=google.com; s=arc-20160816; b=GuBHjGID/AQ89C/8tObLCv1TRDMVmIo2/Xa+JdgmnK8R4IUK0LbolUDlHMWnhjr7ry 1M+zS88FC1lJK+ys3kWlDvh0YKG+jOEdTnVEoYUBJe6MClqvfuJBB7J0qGKqUfV9jKrW aEdWF0+3GVTevyIin1AuP07cWL4ZxAigqhcTA687PLFSYUpSrPhziI7HSh01UC4AVSGV I0hdj8aiu89xSrbgXcWndhCA5pa+nYmI3hPUncTJPlZqcHldRDAPR2JsQm9ASeqHwDhF y9LlykPBq7YMiDfHi5u2gU1OwHyvc7B0XaaVKm5bVxZdtdCj3RqHdb/e9/Hcy7QUQRVY RDXA== 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=Sk9xuwXekVy/x5oYumwW7fTwAhp9P9kDF/6jzFhzRzA=; b=s2C1CrFVZDFp05tAmwNOzNkcFGNXG8zQdJv/sbAeIEImNa+XBbvNKOJG3bhIow/1le ZA/F1Yh8q5OxkBT9EN0yEmQRYFbHNwg7jqlkxpyhqYR4m8Knj4nfoOLSLbeMJ2OxYmrO yh5AdYULc6QjfJ5DYix+MP2xzk6ZWhygeL2JRdafRlaiSi3hsod5iZ5vfgvHsONR4IEA lGFIuC1rFTpgx6+eCxuiBN5TjyNeNDn73C9fMNWyAjmE7ts9mR4IJsBSRNhS5OpRbCaU dcWZyN/NTrhm1fwRaKVtiQhXnsIi6PjeihU2D31EtNJUWJghxGOopMuvgllszgQu9HQi bq0A== 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 k1si8639876ejj.102.2020.09.21.07.52.22; Mon, 21 Sep 2020 07:52:46 -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 S1728263AbgIUOtF (ORCPT + 99 others); Mon, 21 Sep 2020 10:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728042AbgIUOsL (ORCPT ); Mon, 21 Sep 2020 10:48:11 -0400 Received: from smtp1.goneo.de (smtp1.goneo.de [IPv6:2001:1640:5::8:30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD612C0613D3 for ; Mon, 21 Sep 2020 07:48:10 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.goneo.de (Postfix) with ESMTP id 927B123F122; Mon, 21 Sep 2020 16:48:09 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.997 X-Spam-Level: X-Spam-Status: No, score=-2.997 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.097, BAYES_00=-1.9] autolearn=ham Received: from smtp1.goneo.de ([127.0.0.1]) by localhost (smtp1.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b-sX9eMTKTHM; Mon, 21 Sep 2020 16:48:08 +0200 (CEST) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp1.goneo.de (Postfix) with ESMTPA id 1F5AF23F160; Mon, 21 Sep 2020 16:48:08 +0200 (CEST) From: poeschel@lemonage.de To: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel Subject: [PATCH v2 25/32] auxdisplay: Call charlcd_backlight in place Date: Mon, 21 Sep 2020 16:46:37 +0200 Message-Id: <20200921144645.2061313-26-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921144645.2061313-1-poeschel@lemonage.de> References: <20191016082430.5955-1-poeschel@lemonage.de> <20200921144645.2061313-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. 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