All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 10/12] drm/i915: Clean up intel_get_dram_info() a bit
Date: Mon, 25 Feb 2019 22:29:05 +0200	[thread overview]
Message-ID: <20190225202907.731-11-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190225202907.731-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Remove the pointless zero initialization of bunch of things
(the thing is kzalloc()ed).

Also throw out the mostly useless on-stack string. I think
it'll be clear enough from the logs that 0 means unknown.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 21413069a480..e3aafe2bf3b7 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1357,14 +1357,8 @@ static void
 intel_get_dram_info(struct drm_i915_private *dev_priv)
 {
 	struct dram_info *dram_info = &dev_priv->dram_info;
-	char bandwidth_str[32];
 	int ret;
 
-	dram_info->valid = false;
-	dram_info->ranks = 0;
-	dram_info->bandwidth_kbps = 0;
-	dram_info->num_channels = 0;
-
 	/*
 	 * Assume 16Gb DIMMs are present until proven otherwise.
 	 * This is only used for the level 0 watermark latency
@@ -1385,12 +1379,10 @@ intel_get_dram_info(struct drm_i915_private *dev_priv)
 	if (ret)
 		return;
 
-	if (dram_info->bandwidth_kbps)
-		sprintf(bandwidth_str, "%d KBps", dram_info->bandwidth_kbps);
-	else
-		sprintf(bandwidth_str, "unknown");
-	DRM_DEBUG_KMS("DRAM bandwidth:%s, total-channels: %u\n",
-		      bandwidth_str, dram_info->num_channels);
+	DRM_DEBUG_KMS("DRAM bandwidth: %u kBps, channels: %u\n",
+		      dram_info->bandwidth_kbps,
+		      dram_info->num_channels);
+
 	DRM_DEBUG_KMS("DRAM ranks: %d, 16Gb DIMMs: %s\n",
 		      dram_info->ranks, yesno(dram_info->is_16gb_dimm));
 }
-- 
2.19.2

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

  parent reply	other threads:[~2019-02-25 20:29 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 20:28 [PATCH 00/12] Polish DRAM information readout code Ville Syrjala
2019-02-25 20:28 ` [PATCH 01/12] drm/i915: Store DIMM rank information as a number Ville Syrjala
2019-03-04 16:17   ` Jani Nikula
2019-03-04 16:32     ` Ville Syrjälä
2019-02-25 20:28 ` [PATCH 02/12] drm/i915: Extract functions to derive SKL+ DIMM info Ville Syrjala
2019-03-04 16:32   ` Jani Nikula
2019-03-04 16:44     ` Ville Syrjälä
2019-02-25 20:28 ` [PATCH 03/12] drm/i915: Polish skl_is_16gb_dimm() Ville Syrjala
2019-02-26 15:26   ` [PATCH v2 " Ville Syrjala
2019-03-04 18:19     ` Jani Nikula
2019-02-25 20:28 ` [PATCH 04/12] drm/i915: Extract BXT DIMM helpers Ville Syrjala
2019-02-26 15:27   ` [PATCH v2 " Ville Syrjala
2019-03-04 18:26     ` Jani Nikula
2019-02-25 20:29 ` [PATCH 05/12] drm/i915: Fix DRAM size reporting for BXT Ville Syrjala
2019-02-25 20:35   ` Chris Wilson
2019-02-25 20:48     ` Ville Syrjälä
2019-02-25 20:57       ` Chris Wilson
2019-02-25 21:06         ` Ville Syrjälä
2019-02-26 15:27   ` [PATCH v2 " Ville Syrjala
2019-03-04 18:56     ` Jani Nikula
2019-02-25 20:29 ` [PATCH 06/12] drm/i915: Extract DIMM info on GLK too Ville Syrjala
2019-03-05 17:00   ` Jani Nikula
2019-02-25 20:29 ` [PATCH 07/12] drm/i915: Use dram_dimm_info more Ville Syrjala
2019-03-04 19:13   ` Jani Nikula
2019-02-25 20:29 ` [PATCH 08/12] drm/i915: Generalize intel_is_dram_symmetric() Ville Syrjala
2019-03-04 19:57   ` Jani Nikula
2019-02-25 20:29 ` [PATCH 09/12] drm/i914: s/l_info/dimm_l/ etc Ville Syrjala
2019-03-04 19:58   ` Jani Nikula
2019-02-25 20:29 ` Ville Syrjala [this message]
2019-03-04 20:01   ` [PATCH 10/12] drm/i915: Clean up intel_get_dram_info() a bit Jani Nikula
2019-02-25 20:29 ` [PATCH 11/12] drm/i915: Extract DIMM info on cnl+ Ville Syrjala
2019-03-05 16:16   ` Jani Nikula
2019-03-06 19:25     ` Ville Syrjälä
2019-03-06 19:48       ` Jani Nikula
2019-02-25 20:29 ` [PATCH 12/12] drm/i915: Read out memory type Ville Syrjala
2019-02-26 17:57   ` [PATCH v2 " Ville Syrjala
2019-03-05 16:35     ` Jani Nikula
2019-02-25 21:00 ` ✗ Fi.CI.CHECKPATCH: warning for Polish DRAM information readout code Patchwork
2019-02-25 21:04 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-02-25 21:21 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-26  5:52 ` ✓ Fi.CI.IGT: " Patchwork
2019-02-26 15:37 ` ✗ Fi.CI.BAT: failure for Polish DRAM information readout code (rev4) Patchwork
2019-02-26 19:13 ` ✗ Fi.CI.CHECKPATCH: warning for Polish DRAM information readout code (rev5) Patchwork
2019-02-26 19:18 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-02-26 19:42 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-26 23:33 ` ✓ Fi.CI.IGT: " 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=20190225202907.731-11-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.