dm_test_video_text() and dm_test_video_text_12x22() each define WHITE
and SCROLL_LINES inside the function body. Macros are not scoped to a
function, so the second pair only redefines the first, and
check_vidconsole_output() further down uses the SCROLL_LINES defined
inside dm_test_video_text().

Define both once at file scope, before their first user, and drop the
two in-function pairs. No functional change.

Signed-off-by: Aristo Chen <[email protected]>
---
 test/dm/video.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/test/dm/video.c b/test/dm/video.c
index 48ec60c4140..cc854d0e042 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -135,15 +135,15 @@ static int video_get_nologo(struct unit_test_state *uts, 
struct udevice **devp)
        return 0;
 }
 
+#define WHITE          0xffff
+#define SCROLL_LINES   100
+
 /* Test text output works on the video console */
 static int dm_test_video_text(struct unit_test_state *uts)
 {
        struct udevice *dev, *con;
        int i;
 
-#define WHITE          0xffff
-#define SCROLL_LINES   100
-
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
        ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
@@ -183,9 +183,6 @@ static int dm_test_video_text_12x22(struct unit_test_state 
*uts)
        struct udevice *dev, *con;
        int i;
 
-#define WHITE          0xffff
-#define SCROLL_LINES   100
-
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
        ut_assertok(video_get_nologo(uts, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-- 
2.43.0

Reply via email to