Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3712603pxt; Tue, 10 Aug 2021 09:36:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywFxw1dMPQBUwEXkbwZOqqzgd5MR3kFX2/ZrWTYAn2DGPlFxijzWDwGpmrlEA40DJbr2F0 X-Received: by 2002:a92:a30d:: with SMTP id a13mr465546ili.181.1628613379241; Tue, 10 Aug 2021 09:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628613379; cv=none; d=google.com; s=arc-20160816; b=tVCAeDDKIhYPGc4e+sk3JY3Mr4T5aqBJizJzI0R42wW2w6DnM0wiP1SfTyXg48usYP w+fHk0sJfKbrEpeF4qg9asXIQLkTC6uL0hDnKVYji3rt1ixhhqTEEbxFv4oOkKvnlS28 86TC1LKKU/Lax/lyhOjsbvwx9UCwvCAvesUCyhlOgaGaWWA5/kg1Jzeqgd0p+fHSMBrV YQjN0jjimInESEwQCFfWoyxO4TLIBBSuavF2CCqgoWS59WMD19LiU5PUGA9cCBGru4/3 fVdsQVcHgf+0DpWyIgspD8aldh1uWUqe9HYcRdrgP9ZpZ/iIU5ArXvNuwKMdQ+08aoWf o2wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WBj9jDzdrpkQARXB3cjFr72FO41wqr8C2m6gqeyQkOM=; b=P7gtGO1kGsZC4DMpXGG5GrFQd10m3nI9XCu9jn6fDt79Zv2dXkTSv68iKVunjOCOsG jMfIU+V6SV7MfCd23TtXB5tShDMFdpOTj4wGDNlJt+7eoUcBFCtMGdXpAPY3iaH9/3lO s2pTN3CbFhOKRPDcppvuyoh12yjbi2rsQlYr+AdmvytooBm1I9COu9lR4t+Larl1T67Z qdVhqWsgvaj1D3QhIVI6BD465vcDvuR6Gobhn5uMuOfGShFOITl+lrSD2h+ef3xzrTyO C92ODbXHURcVsOxvqZ9CkPD93SvkhuwjMkA+M+YSQjgYFNTddOjsNL4350uuNq1g1Pnh oIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G5H3i1qJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si4168393ile.126.2021.08.10.09.36.08; Tue, 10 Aug 2021 09:36:19 -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=@gmail.com header.s=20161025 header.b=G5H3i1qJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242184AbhHJON6 (ORCPT + 99 others); Tue, 10 Aug 2021 10:13:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240474AbhHJON5 (ORCPT ); Tue, 10 Aug 2021 10:13:57 -0400 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E351C0613C1 for ; Tue, 10 Aug 2021 07:13:35 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id d10-20020a9d4f0a0000b02904f51c5004e3so17739734otl.9 for ; Tue, 10 Aug 2021 07:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WBj9jDzdrpkQARXB3cjFr72FO41wqr8C2m6gqeyQkOM=; b=G5H3i1qJW9zU2sRnzNTDSWEAviRi5xYzX3sXOLng8kmOXC8SlYtH/pO83+FQFamtev mQWemttbtv/NZqWhr57X2ZML7YQStNfVc35CW862oeR7Zj6FXZkLLMr3LFMXIQx1uYQB ApIWDHC5af8fq77CUZyP2c+10o3dADueNjrProCLo1N1WCW8J+1G3ReM/5PT1frtnOY/ QQJuE66EI6nDjs9A1rk8H5Y2iJMIKvqip2p1YdBzEZxdvBRU1hSocjOFfs21Hd+9XBiZ xF01NEYDgwJipsvicygnP92Cu8zA4UUtPcE0A/HCSUN4lIktwTT+R+8CJl6p0R2EHOEs SB3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WBj9jDzdrpkQARXB3cjFr72FO41wqr8C2m6gqeyQkOM=; b=d+uKDQ9Vn7ZLTwBwAKAuyaTsh2TeLhThgHaehE7Lrc6xzL/lngFCYIX+jvDZRGDgvO XSryKWzHPJSG447UdTxtbVRmyHBvvo02awd6/Sl6yqZCDHuFi92FDD3lohRsuVaS2LQx T+mtZwg/7NcAmHqjKmZP6A58DFLw34REKZdGvvYjw7TnQ0CC9xcxS0O280BfRPP09U6W 1/BGQncNbZE2qSm8/n2ktCV+r+Ik8v07SxaUPZgtJ3fPpEgcKudlHyV22N6SvC6W0byn hgbQ6AG/3mnSeKMypCQrxbXEBxxn4rHLbqfpv55bAYgYIIVMNPMjAIiNG1RbsORiJ+gy 6CLw== X-Gm-Message-State: AOAM530JFGNcS28V0e868WDV4x/QvMkHfcb8yLeBpoLcIqgdBlCr92Fv vb+dBrDOliJWRuDGycYgc62BO95eI+acVIO9QK4= X-Received: by 2002:a05:6830:1e78:: with SMTP id m24mr15296402otr.23.1628604815033; Tue, 10 Aug 2021 07:13:35 -0700 (PDT) MIME-Version: 1.0 References: <20210810012304.28068-1-zhaoxiao@uniontech.com> In-Reply-To: <20210810012304.28068-1-zhaoxiao@uniontech.com> From: Alex Deucher Date: Tue, 10 Aug 2021 10:13:24 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/display: remove variable backlight To: zhaoxiao Cc: Dave Airlie , Daniel Vetter , "Wentland, Harry" , "Leo (Sunpeng) Li" , "Deucher, Alexander" , Christian Koenig , xinhui pan , Nirmoy Das , amd-gfx list , Maling list - DRI developers , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 9, 2021 at 9:24 PM zhaoxiao wrote: > > The variable backlight is being initialized with a value that > is never read, it is being re-assigned immediately afterwards. I don't think this comment really matches the code. I think you can drop it. Alex > Clean up the code by removing the need for variable backlight. > > Signed-off-by: zhaoxiao > --- > drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c > index 874b132fe1d7..0808433185f8 100644 > --- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c > +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c > @@ -177,23 +177,21 @@ static void dce_abm_init(struct abm *abm, uint32_t backlight) > static unsigned int dce_abm_get_current_backlight(struct abm *abm) > { > struct dce_abm *abm_dce = TO_DCE_ABM(abm); > - unsigned int backlight = REG_READ(BL1_PWM_CURRENT_ABM_LEVEL); > > /* return backlight in hardware format which is unsigned 17 bits, with > * 1 bit integer and 16 bit fractional > */ > - return backlight; > + return REG_READ(BL1_PWM_CURRENT_ABM_LEVEL); > } > > static unsigned int dce_abm_get_target_backlight(struct abm *abm) > { > struct dce_abm *abm_dce = TO_DCE_ABM(abm); > - unsigned int backlight = REG_READ(BL1_PWM_TARGET_ABM_LEVEL); > > /* return backlight in hardware format which is unsigned 17 bits, with > * 1 bit integer and 16 bit fractional > */ > - return backlight; > + return REG_READ(BL1_PWM_TARGET_ABM_LEVEL); > } > > static bool dce_abm_set_level(struct abm *abm, uint32_t level) > -- > 2.20.1 > > >