Commit 7056a2bc authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jani Nikula

drm/dp/mst: Fix off-by-one typo when dump payload table

It seems there is a classical off-by-one typo from the beginning
when commit

  ad7f8a1f ("drm/helper: add Displayport multi-stream helper (v0.6)")

introduced a new helper.

Fix a typo by introducing a macro constant.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180319141932.37290-1-andriy.shevchenko@linux.intel.com
parent a7d2a87e
...@@ -2941,12 +2941,14 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m, ...@@ -2941,12 +2941,14 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m,
} }
} }
#define DP_PAYLOAD_TABLE_SIZE 64
static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr,
char *buf) char *buf)
{ {
int i; int i;
for (i = 0; i < 64; i += 16) { for (i = 0; i < DP_PAYLOAD_TABLE_SIZE; i += 16) {
if (drm_dp_dpcd_read(mgr->aux, if (drm_dp_dpcd_read(mgr->aux,
DP_PAYLOAD_TABLE_UPDATE_STATUS + i, DP_PAYLOAD_TABLE_UPDATE_STATUS + i,
&buf[i], 16) != 16) &buf[i], 16) != 16)
...@@ -3015,7 +3017,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m, ...@@ -3015,7 +3017,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m,
mutex_lock(&mgr->lock); mutex_lock(&mgr->lock);
if (mgr->mst_primary) { if (mgr->mst_primary) {
u8 buf[64]; u8 buf[DP_PAYLOAD_TABLE_SIZE];
int ret; int ret;
ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE); ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE);
...@@ -3033,8 +3035,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m, ...@@ -3033,8 +3035,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m,
seq_printf(m, " revision: hw: %x.%x sw: %x.%x\n", seq_printf(m, " revision: hw: %x.%x sw: %x.%x\n",
buf[0x9] >> 4, buf[0x9] & 0xf, buf[0xa], buf[0xb]); buf[0x9] >> 4, buf[0x9] & 0xf, buf[0xa], buf[0xb]);
if (dump_dp_payload_table(mgr, buf)) if (dump_dp_payload_table(mgr, buf))
seq_printf(m, "payload table: %*ph\n", 63, buf); seq_printf(m, "payload table: %*ph\n", DP_PAYLOAD_TABLE_SIZE, buf);
} }
mutex_unlock(&mgr->lock); mutex_unlock(&mgr->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment