All of lore.kernel.org
 help / color / mirror / Atom feed
From: waynelin <Wayne.Lin@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>,
	"Fangzhi Zuo" <jerry.zuo@amd.com>,
	Daniel Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
	Alex Hung <alex.hung@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH 07/10] drm/amd/display: Drop unnecessary 'rc' variable in amdgpu_dm_backlight_get_level()
Date: Tue, 15 Jul 2025 14:49:31 +0800	[thread overview]
Message-ID: <20250715065233.160043-8-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20250715065233.160043-1-Wayne.Lin@amd.com>

From: Mario Limonciello <mario.limonciello@amd.com>

[Why]
amdgpu_dm_backlight_get_level() returns a boolean value but is assigned
to a variable named 'rc' which is generally used for return codes.

This can be confusing while looking at the code for other issues.

[How]
Drop the variable and just look directly at the return value of
amdgpu_dm_backlight_get_level() in the if statement.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 096b23ad4845..129476b6d5fa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4924,10 +4924,8 @@ static u32 amdgpu_dm_backlight_get_level(struct amdgpu_display_manager *dm,
 
 	if (caps.aux_support) {
 		u32 avg, peak;
-		bool rc;
 
-		rc = dc_link_get_backlight_level_nits(link, &avg, &peak);
-		if (!rc)
+		if (!dc_link_get_backlight_level_nits(link, &avg, &peak))
 			return dm->brightness[bl_idx];
 		return convert_brightness_to_user(&caps, avg);
 	}
-- 
2.43.0


  parent reply	other threads:[~2025-07-15  6:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15  6:49 [PATCH 00/10] DC Patches July 21, 2025 waynelin
2025-07-15  6:49 ` [PATCH 01/10] drm/amd/display: [FW Promotion] Release 0.1.18.0 waynelin
2025-07-15  6:49 ` [PATCH 02/10] drm/amd/display: Promote DAL to 3.2.341 waynelin
2025-07-15  6:49 ` [PATCH 03/10] drm/amd/display: Update tiled to tiled copy command waynelin
2025-07-15  6:49 ` [PATCH 04/10] drm/amd/display: fix condition for setting timing_adjust_pending waynelin
2025-07-15  6:49 ` [PATCH 05/10] drm/amd/display: Revert Add HPO encoder support to Replay waynelin
2025-07-15  6:49 ` [PATCH 06/10] drm/amd/display: ensure committing streams is seamless waynelin
2025-07-15  6:49 ` waynelin [this message]
2025-07-15  6:49 ` [PATCH 08/10] drm/amd/display: Fix divide by zero when calculating min ODM factor waynelin
2025-07-15  6:49 ` [PATCH 09/10] drm/amd/display: [FW Promotion] Release 0.1.19.0 waynelin
2025-07-15  6:49 ` [PATCH 10/10] drm/amd/display: Promote DAL to 3.2.342 waynelin
2025-07-21 13:41 ` [PATCH 00/10] DC Patches July 21, 2025 Wheeler, Daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250715065233.160043-8-Wayne.Lin@amd.com \
    --to=wayne.lin@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=alex.hung@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=roman.li@amd.com \
    --cc=sunpeng.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.