Commit 57ba4d53 authored by Darshan R.'s avatar Darshan R. Committed by Helge Deller
Browse files

fbdev: svgalib: Clean up coding style



This patch addresses various coding style issues in `svgalib.c` to improve
readability and better align the code with the Linux kernel's formatting
standards.

The changes primarily consist of:
- Adjusting whitespace around operators and after keywords.
- Standardizing brace placement for control flow statements.
- Removing unnecessary braces on single-statement if/else blocks.
- Deleting extraneous blank lines throughout the file.

These changes are purely stylistic and introduce no functional modifications.

Signed-off-by: default avatarDarshan R. <rathod.darshan.0896@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 32dfb611
Loading
Loading
Loading
Loading
+42 −53
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
#include <asm/types.h>
#include <asm/io.h>


/* Write a CRT register value spread across multiple registers */
void svga_wcrt_multi(void __iomem *regbase, const struct vga_regset *regset, u32 value)
{
@@ -31,7 +30,8 @@ void svga_wcrt_multi(void __iomem *regbase, const struct vga_regset *regset, u32
		while (bitnum <= regset->highbit) {
			bitval = 1 << bitnum;
			regval = regval & ~bitval;
			if (value & 1) regval = regval | bitval;
			if (value & 1)
				regval = regval | bitval;
			bitnum++;
			value = value >> 1;
		}
@@ -51,7 +51,8 @@ void svga_wseq_multi(void __iomem *regbase, const struct vga_regset *regset, u32
		while (bitnum <= regset->highbit) {
			bitval = 1 << bitnum;
			regval = regval & ~bitval;
			if (value & 1) regval = regval | bitval;
			if (value & 1)
				regval = regval | bitval;
			bitnum++;
			value = value >> 1;
		}
@@ -71,10 +72,8 @@ static unsigned int svga_regset_size(const struct vga_regset *regset)
	return 1 << count;
}


/* ------------------------------------------------------------------------- */


/* Set graphics controller registers to sane values */
void svga_set_default_gfx_regs(void __iomem *regbase)
{
@@ -187,10 +186,8 @@ void svga_dump_var(struct fb_var_screeninfo *var, int node)
}
#endif  /*  0  */


/* ------------------------------------------------------------------------- */


void svga_settile(struct fb_info *info, struct fb_tilemap *map)
{
	const u8 *font = map->data;
@@ -292,11 +289,11 @@ void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit)
			fb_writeb(attr, fb2 + 1);
			fb2 += colstride;
			i++;
			if (i == blit->length) return;
			if (i == blit->length)
				return;
		}
		fb += rowstride;
	}

}

/* Set cursor in text (tileblit) mode */
@@ -374,7 +371,6 @@ EXPORT_SYMBOL(svga_get_caps);

/* ------------------------------------------------------------------------- */


/*
 *  Compute PLL settings (M, N, R)
 *  F_VCO = (F_BASE * M) / N
@@ -424,12 +420,11 @@ int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u
			*n = an;
		}

		if (f_current <= f_vco) {
		if (f_current <= f_vco)
			am++;
		} else {
		else
			an++;
	}
	}

	f_current = (pll->f_base * *m) / *n;
	pr_debug("fb%d: found frequency: %d kHz (VCO %d kHz)\n", node, (int)(f_current >> ar), (int)f_current);
@@ -437,10 +432,8 @@ int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u
	return 0;
}


/* ------------------------------------------------------------------------- */


/* Check CRT timing values */
int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node)
{
@@ -596,18 +589,15 @@ void svga_set_timings(void __iomem *regbase, const struct svga_timing_regs *tm,
	vga_w(regbase, VGA_MIS_W, regval);
}


/* ------------------------------------------------------------------------- */


static inline int match_format(const struct svga_fb_format *frm,
			       struct fb_var_screeninfo *var)
{
	int i = 0;
	int stored = -EINVAL;

	while (frm->bits_per_pixel != SVGA_FORMAT_END_VAL)
	{
	while (frm->bits_per_pixel != SVGA_FORMAT_END_VAL) {
		if ((var->bits_per_pixel == frm->bits_per_pixel) &&
		    (var->red.length     <= frm->red.length)     &&
		    (var->green.length   <= frm->green.length)   &&
@@ -647,7 +637,6 @@ int svga_match_format(const struct svga_fb_format *frm,
	return i;
}


EXPORT_SYMBOL(svga_wcrt_multi);
EXPORT_SYMBOL(svga_wseq_multi);