intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Ciobanu <nathan.d.ciobanu@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Marc Herbert <marc.herbert@intel.com>,
	Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH v5] drm/i915/dp: Refactor max_vswing_tries variable
Date: Thu, 19 Jul 2018 17:07:48 -0700	[thread overview]
Message-ID: <1532045268-12938-1-git-send-email-nathan.d.ciobanu@linux.intel.com> (raw)
In-Reply-To: <1532036887-11800-1-git-send-email-nathan.d.ciobanu@linux.intel.com>

Changes the type and renames the max_vswing_tries variable
which was declared as an integer but used as a boolean
making it easy to be confused with a counter.

Changes in v2:
    - updated the title and commit message
    - left the loop exit point in place

v3: fix typo in title

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dp_link_training.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp_link_training.c b/drivers/gpu/drm/i915/intel_dp_link_training.c
index 7903de7a54c9..ec5f2bb55c9a 100644
--- a/drivers/gpu/drm/i915/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/intel_dp_link_training.c
@@ -129,7 +129,8 @@ static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp)
 intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp)
 {
 	uint8_t voltage;
-	int voltage_tries, max_vswing_tries, cr_tries, max_cr_tries;
+	int voltage_tries, cr_tries, max_cr_tries;
+	bool max_vswing = false;
 	uint8_t link_config[2];
 	uint8_t link_bw, rate_select;
 
@@ -181,7 +182,6 @@ static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp)
 		max_cr_tries = 80;
 
 	voltage_tries = 1;
-	max_vswing_tries = 0;
 	for (cr_tries = 0; cr_tries < max_cr_tries; ++cr_tries) {
 		uint8_t link_status[DP_LINK_STATUS_SIZE];
 
@@ -202,7 +202,7 @@ static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp)
 			return false;
 		}
 
-		if (max_vswing_tries == 1) {
+		if (max_vswing) {
 			DRM_DEBUG_KMS("Max Voltage Swing reached\n");
 			return false;
 		}
@@ -223,7 +223,7 @@ static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp)
 			voltage_tries = 1;
 
 		if (intel_dp_link_max_vswing_reached(intel_dp))
-			++max_vswing_tries;
+			max_vswing = true;
 
 	}
 	DRM_ERROR("Failed clock recovery %d times, giving up!\n", max_cr_tries);
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-07-20  0:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 21:48 [PATCH v5 2/2] drm/i915/dp: Refactor mav_vswing_tries variable Nathan Ciobanu
2018-07-20  0:07 ` Nathan Ciobanu [this message]
2018-07-20  0:29 ` ✗ Fi.CI.BAT: failure for series starting with [v5,2/2] drm/i915/dp: Refactor mav_vswing_tries variable (rev2) Patchwork
2018-07-20 10:19 ` [PATCH v5 2/2] drm/i915/dp: Refactor mav_vswing_tries variable Ville Syrjälä
2018-07-20 18:27   ` Nathan Ciobanu
2018-07-20 18:23 ` [PATCH v5] drm/i915/dp: Refactor max_vswing_tries variable Nathan Ciobanu
2018-07-20 19:12   ` Rodrigo Vivi
2018-07-20 19:16 ` ✗ Fi.CI.BAT: failure for series starting with [v5] drm/i915/dp: Refactor max_vswing_tries variable (rev3) Patchwork

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=1532045268-12938-1-git-send-email-nathan.d.ciobanu@linux.intel.com \
    --to=nathan.d.ciobanu@linux.intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=marc.herbert@intel.com \
    --cc=rodrigo.vivi@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).