Skip to content

Commit 30a533e

Browse files
committed
drm/i915: Clean up intel_get_dram_info() a bit
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. Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1d55967 commit 30a533e

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/gpu/drm/i915/i915_drv.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,14 +1363,8 @@ static void
13631363
intel_get_dram_info(struct drm_i915_private *dev_priv)
13641364
{
13651365
struct dram_info *dram_info = &dev_priv->dram_info;
1366-
char bandwidth_str[32];
13671366
int ret;
13681367

1369-
dram_info->valid = false;
1370-
dram_info->ranks = 0;
1371-
dram_info->bandwidth_kbps = 0;
1372-
dram_info->num_channels = 0;
1373-
13741368
/*
13751369
* Assume 16Gb DIMMs are present until proven otherwise.
13761370
* This is only used for the level 0 watermark latency
@@ -1391,12 +1385,10 @@ intel_get_dram_info(struct drm_i915_private *dev_priv)
13911385
if (ret)
13921386
return;
13931387

1394-
if (dram_info->bandwidth_kbps)
1395-
sprintf(bandwidth_str, "%d KBps", dram_info->bandwidth_kbps);
1396-
else
1397-
sprintf(bandwidth_str, "unknown");
1398-
DRM_DEBUG_KMS("DRAM bandwidth:%s, total-channels: %u\n",
1399-
bandwidth_str, dram_info->num_channels);
1388+
DRM_DEBUG_KMS("DRAM bandwidth: %u kBps, channels: %u\n",
1389+
dram_info->bandwidth_kbps,
1390+
dram_info->num_channels);
1391+
14001392
DRM_DEBUG_KMS("DRAM ranks: %u, 16Gb DIMMs: %s\n",
14011393
dram_info->ranks, yesno(dram_info->is_16gb_dimm));
14021394
}

0 commit comments

Comments
 (0)