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>
This commit is contained in:
Jeremy Compostella 2022-12-07 17:08:03 -07:00 committed by Felix Held
parent 4c3749884d
commit 355471aa74
1 changed files with 7 additions and 7 deletions

View File

@ -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