From 465001c775a516ac1c7c24302593b02c0f73f486 Mon Sep 17 00:00:00 2001 From: José Roberto de Souza Date: Tue, 23 Oct 2018 13:57:02 -0700 Subject: lib/psr: Add a macro with the maximum lenght of i915_edp_psr_status and use it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So every function reading i915_edp_psr_status can allocate a buffer long enough. Cc: Dhinakaran Pandiyan Reviewed-by: Dhinakaran Pandiyan Signed-off-by: José Roberto de Souza --- tests/kms_fbcon_fbt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/kms_fbcon_fbt.c') diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c index 24d3ad90..0ad53266 100644 --- a/tests/kms_fbcon_fbt.c +++ b/tests/kms_fbcon_fbt.c @@ -170,7 +170,7 @@ static void set_mode_for_one_screen(struct drm_info *drm, struct igt_fb *fb, static bool psr_supported_on_chipset(int debugfs_fd) { - char buf[256]; + char buf[PSR_STATUS_MAX_LEN]; int ret; ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", @@ -188,7 +188,7 @@ static bool connector_can_psr(drmModeConnectorPtr connector) static void psr_print_status(int debugfs_fd) { - static char buf[256]; + static char buf[PSR_STATUS_MAX_LEN]; igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf, sizeof(buf)); @@ -197,7 +197,7 @@ static void psr_print_status(int debugfs_fd) static bool psr_is_enabled(int debugfs_fd) { - char buf[256]; + char buf[PSR_STATUS_MAX_LEN]; igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf, sizeof(buf)); -- cgit v1.2.3