All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aristo Chen <aristo.chen@canonical.com>
To: u-boot@lists.u-boot-project.org
Cc: trini@konsulko.com, Aristo Chen <aristo.chen@canonical.com>,
	Simon Glass <sjg@chromium.org>,
	Shahriyar Jalayeri <shahriyar@byteray.co.uk>
Subject: [PATCH v1 6/6] test: video: define WHITE and SCROLL_LINES once at file scope
Date: Fri,  2 Oct 2026 07:31:56 +0000	[thread overview]
Message-ID: <20261002073357.382228-7-aristo.chen@canonical.com> (raw)
In-Reply-To: <20261002073357.382228-1-aristo.chen@canonical.com>

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 <aristo.chen@canonical.com>
---
 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


  parent reply	other threads:[~2026-10-02 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02  7:31 [PATCH v1 0/6] Drop duplicate macro definitions Aristo Chen
2026-10-02  7:31 ` [PATCH v1 1/6] mtd: spi-nor: drop the duplicate EN4B/EX4B opcode definitions Aristo Chen
2026-10-02  7:43   ` Takahiro.Kuwano
2026-10-03 13:25   ` Simon Glass
2026-10-02  7:31 ` [PATCH v1 2/6] scsi: drop the duplicate COMPARE and SEND DIAGNOSTIC opcodes Aristo Chen
2026-10-03 13:25   ` Simon Glass
2026-10-02  7:31 ` [PATCH v1 3/6] acpi: drop the duplicate ACPI_PPTT_CACHE_TYPE_DATA definition Aristo Chen
2026-10-03 13:42   ` Simon Glass
2026-10-02  7:31 ` [PATCH v1 4/6] pci: gt64120: drop the duplicate GT_PCI1M1LD/HD_OFS definitions Aristo Chen
2026-10-03 13:40   ` Simon Glass
2026-10-02  7:31 ` [PATCH v1 5/6] dt-bindings: soc: imx8_pd: drop the duplicate PD_LVDS0_PWM definition Aristo Chen
2026-10-03 13:28   ` Simon Glass
2026-10-02  7:31 ` Aristo Chen [this message]
2026-10-03  5:40   ` [PATCH v1 6/6] test: video: define WHITE and SCROLL_LINES once at file scope Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261002073357.382228-7-aristo.chen@canonical.com \
    --to=aristo.chen@canonical.com \
    --cc=shahriyar@byteray.co.uk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.