diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-03-19 10:19:32 -0400 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2018-03-28 02:12:16 -0400 |
commit | 7056a2bccc3b5afc51f9b35b30a46f0d9219968d (patch) | |
tree | 6fbd0166c96cc542fd4656f3d0487de3c896b24e /drivers/gpu/drm/drm_dp_mst_topology.c | |
parent | a7d2a87e99deb5481b5dd723408c42f460de25a3 (diff) |
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
ad7f8a1f9ced ("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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180319141932.37290-1-andriy.shevchenko@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_dp_mst_topology.c')
-rw-r--r-- | drivers/gpu/drm/drm_dp_mst_topology.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 6fac4129e6a2..658830620ca3 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c | |||
@@ -2941,12 +2941,14 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m, | |||
2941 | } | 2941 | } |
2942 | } | 2942 | } |
2943 | 2943 | ||
2944 | #define DP_PAYLOAD_TABLE_SIZE 64 | ||
2945 | |||
2944 | static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, | 2946 | static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, |
2945 | char *buf) | 2947 | char *buf) |
2946 | { | 2948 | { |
2947 | int i; | 2949 | int i; |
2948 | 2950 | ||
2949 | for (i = 0; i < 64; i += 16) { | 2951 | for (i = 0; i < DP_PAYLOAD_TABLE_SIZE; i += 16) { |
2950 | if (drm_dp_dpcd_read(mgr->aux, | 2952 | if (drm_dp_dpcd_read(mgr->aux, |
2951 | DP_PAYLOAD_TABLE_UPDATE_STATUS + i, | 2953 | DP_PAYLOAD_TABLE_UPDATE_STATUS + i, |
2952 | &buf[i], 16) != 16) | 2954 | &buf[i], 16) != 16) |
@@ -3015,7 +3017,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m, | |||
3015 | 3017 | ||
3016 | mutex_lock(&mgr->lock); | 3018 | mutex_lock(&mgr->lock); |
3017 | if (mgr->mst_primary) { | 3019 | if (mgr->mst_primary) { |
3018 | u8 buf[64]; | 3020 | u8 buf[DP_PAYLOAD_TABLE_SIZE]; |
3019 | int ret; | 3021 | int ret; |
3020 | 3022 | ||
3021 | ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE); | 3023 | 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 | seq_printf(m, " revision: hw: %x.%x sw: %x.%x\n", | 3035 | seq_printf(m, " revision: hw: %x.%x sw: %x.%x\n", |
3034 | buf[0x9] >> 4, buf[0x9] & 0xf, buf[0xa], buf[0xb]); | 3036 | buf[0x9] >> 4, buf[0x9] & 0xf, buf[0xa], buf[0xb]); |
3035 | if (dump_dp_payload_table(mgr, buf)) | 3037 | if (dump_dp_payload_table(mgr, buf)) |
3036 | seq_printf(m, "payload table: %*ph\n", 63, buf); | 3038 | seq_printf(m, "payload table: %*ph\n", DP_PAYLOAD_TABLE_SIZE, buf); |
3037 | |||
3038 | } | 3039 | } |
3039 | 3040 | ||
3040 | mutex_unlock(&mgr->lock); | 3041 | mutex_unlock(&mgr->lock); |