summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Compostella <jeremy.compostella@intel.com>2022-12-07 17:08:03 -0700
committerFelix Held <felix-coreboot@felixheld.de>2022-12-12 15:06:42 +0000
commit355471aa74be71a302e703c3d0ef4e1d01cc08a0 (patch)
tree62d6d3efc31320871efdc6cfbb7ad7a654bd3605 /src
parent4c3749884d717b6816098a1a29a95bff7a706838 (diff)
drivers/pc80/vga: Fix coding style issues
- Use `size_t' for iteration index variables - Use the `VGA_COLUMN' macro definition instead of the hard-coded value BUG=b:252792591 BRANCH=firmware-brya-14505.B TEST=Verified on Skolas Change-Id: I1d6595871363ec7602219e72d1260df3722f64de Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70453 Reviewed-by: Tarun Tuli <taruntuli@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/pc80/vga/vga.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/drivers/pc80/vga/vga.c b/src/drivers/pc80/vga/vga.c
index d970fea6b1..9961e3f59d 100644
--- a/src/drivers/pc80/vga/vga.c
+++ b/src/drivers/pc80/vga/vga.c
@@ -60,7 +60,7 @@ vga_fb_clear(void)
static void
vga_palette_init(void)
{
- unsigned int i;
+ size_t i;
/* set up attribute registers */
for (i = 0; i < 0x10; i++)
@@ -168,7 +168,7 @@ static void
vga_font_8x16_load(void)
{
unsigned char *p;
- int i, j;
+ size_t i, j;
unsigned char sr2, sr4, gr5, gr6;
#define height 16
@@ -236,7 +236,7 @@ vga_cursor_reset(void)
void
vga_cursor_set(unsigned int line, unsigned int character)
{
- unsigned int offset = (80 * line + character) & 0xFFFF;
+ unsigned int offset = (VGA_COLUMNS * line + character) & 0xFFFF;
vga_cr_write(0x0A, 0x0E);
vga_cr_write(0x0B, 0x0E);
@@ -250,7 +250,7 @@ vga_cursor_set(unsigned int line, unsigned int character)
void
vga_frame_set(unsigned int line, unsigned int character)
{
- unsigned int offset = (80 * line + character) & 0xFFFF;
+ unsigned int offset = (VGA_COLUMNS * line + character) & 0xFFFF;
vga_cr_write(0x0C, offset >> 8);
vga_cr_write(0x0D, offset & 0xFF);
@@ -262,10 +262,10 @@ vga_frame_set(unsigned int line, unsigned int character)
void
vga_line_write(unsigned int line, const char *string)
{
- unsigned short *p = (unsigned short *)VGA_FB + (80 * line);
- int i, len = strlen(string);
+ unsigned short *p = (unsigned short *)VGA_FB + (VGA_COLUMNS * line);
+ size_t i, len = strlen(string);
- for (i = 0; i < 80; i++) {
+ for (i = 0; i < VGA_COLUMNS; i++) {
if (i < len)
p[i] = 0x0F00 | string[i];
else