Commit a94ddf3a authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] early_printk: cleanup trailiing whitespace

Remove all trailing tabs and spaces.  No other changes.
Signed-off-by: default avatarRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ebcf28e1
...@@ -60,7 +60,7 @@ static struct console early_vga_console = { ...@@ -60,7 +60,7 @@ static struct console early_vga_console = {
.index = -1, .index = -1,
}; };
/* Serial functions loosely based on a similar package from Klaus P. Gerlicher */ /* Serial functions loosely based on a similar package from Klaus P. Gerlicher */
static int early_serial_base = 0x3f8; /* ttyS0 */ static int early_serial_base = 0x3f8; /* ttyS0 */
...@@ -80,30 +80,30 @@ static int early_serial_base = 0x3f8; /* ttyS0 */ ...@@ -80,30 +80,30 @@ static int early_serial_base = 0x3f8; /* ttyS0 */
#define DLL 0 /* Divisor Latch Low */ #define DLL 0 /* Divisor Latch Low */
#define DLH 1 /* Divisor latch High */ #define DLH 1 /* Divisor latch High */
static int early_serial_putc(unsigned char ch) static int early_serial_putc(unsigned char ch)
{ {
unsigned timeout = 0xffff; unsigned timeout = 0xffff;
while ((inb(early_serial_base + LSR) & XMTRDY) == 0 && --timeout) while ((inb(early_serial_base + LSR) & XMTRDY) == 0 && --timeout)
cpu_relax(); cpu_relax();
outb(ch, early_serial_base + TXR); outb(ch, early_serial_base + TXR);
return timeout ? 0 : -1; return timeout ? 0 : -1;
} }
static void early_serial_write(struct console *con, const char *s, unsigned n) static void early_serial_write(struct console *con, const char *s, unsigned n)
{ {
while (*s && n-- > 0) { while (*s && n-- > 0) {
early_serial_putc(*s); early_serial_putc(*s);
if (*s == '\n') if (*s == '\n')
early_serial_putc('\r'); early_serial_putc('\r');
s++; s++;
} }
} }
#define DEFAULT_BAUD 9600 #define DEFAULT_BAUD 9600
static __init void early_serial_init(char *s) static __init void early_serial_init(char *s)
{ {
unsigned char c; unsigned char c;
unsigned divisor; unsigned divisor;
unsigned baud = DEFAULT_BAUD; unsigned baud = DEFAULT_BAUD;
char *e; char *e;
...@@ -112,7 +112,7 @@ static __init void early_serial_init(char *s) ...@@ -112,7 +112,7 @@ static __init void early_serial_init(char *s)
++s; ++s;
if (*s) { if (*s) {
unsigned port; unsigned port;
if (!strncmp(s,"0x",2)) { if (!strncmp(s,"0x",2)) {
early_serial_base = simple_strtoul(s, &e, 16); early_serial_base = simple_strtoul(s, &e, 16);
} else { } else {
...@@ -136,16 +136,16 @@ static __init void early_serial_init(char *s) ...@@ -136,16 +136,16 @@ static __init void early_serial_init(char *s)
outb(0x3, early_serial_base + MCR); /* DTR + RTS */ outb(0x3, early_serial_base + MCR); /* DTR + RTS */
if (*s) { if (*s) {
baud = simple_strtoul(s, &e, 0); baud = simple_strtoul(s, &e, 0);
if (baud == 0 || s == e) if (baud == 0 || s == e)
baud = DEFAULT_BAUD; baud = DEFAULT_BAUD;
} }
divisor = 115200 / baud; divisor = 115200 / baud;
c = inb(early_serial_base + LCR); c = inb(early_serial_base + LCR);
outb(c | DLAB, early_serial_base + LCR); outb(c | DLAB, early_serial_base + LCR);
outb(divisor & 0xff, early_serial_base + DLL); outb(divisor & 0xff, early_serial_base + DLL);
outb((divisor >> 8) & 0xff, early_serial_base + DLH); outb((divisor >> 8) & 0xff, early_serial_base + DLH);
outb(c & ~DLAB, early_serial_base + LCR); outb(c & ~DLAB, early_serial_base + LCR);
} }
...@@ -202,68 +202,68 @@ struct console *early_console = &early_vga_console; ...@@ -202,68 +202,68 @@ struct console *early_console = &early_vga_console;
static int early_console_initialized = 0; static int early_console_initialized = 0;
void early_printk(const char *fmt, ...) void early_printk(const char *fmt, ...)
{ {
char buf[512]; char buf[512];
int n; int n;
va_list ap; va_list ap;
va_start(ap,fmt); va_start(ap,fmt);
n = vscnprintf(buf,512,fmt,ap); n = vscnprintf(buf,512,fmt,ap);
early_console->write(early_console,buf,n); early_console->write(early_console,buf,n);
va_end(ap); va_end(ap);
} }
static int __initdata keep_early; static int __initdata keep_early;
int __init setup_early_printk(char *opt) int __init setup_early_printk(char *opt)
{ {
char *space; char *space;
char buf[256]; char buf[256];
if (early_console_initialized) if (early_console_initialized)
return -1; return -1;
strlcpy(buf,opt,sizeof(buf)); strlcpy(buf,opt,sizeof(buf));
space = strchr(buf, ' '); space = strchr(buf, ' ');
if (space) if (space)
*space = 0; *space = 0;
if (strstr(buf,"keep")) if (strstr(buf,"keep"))
keep_early = 1; keep_early = 1;
if (!strncmp(buf, "serial", 6)) { if (!strncmp(buf, "serial", 6)) {
early_serial_init(buf + 6); early_serial_init(buf + 6);
early_console = &early_serial_console; early_console = &early_serial_console;
} else if (!strncmp(buf, "ttyS", 4)) { } else if (!strncmp(buf, "ttyS", 4)) {
early_serial_init(buf); early_serial_init(buf);
early_console = &early_serial_console; early_console = &early_serial_console;
} else if (!strncmp(buf, "vga", 3) } else if (!strncmp(buf, "vga", 3)
&& SCREEN_INFO.orig_video_isVGA == 1) { && SCREEN_INFO.orig_video_isVGA == 1) {
max_xpos = SCREEN_INFO.orig_video_cols; max_xpos = SCREEN_INFO.orig_video_cols;
max_ypos = SCREEN_INFO.orig_video_lines; max_ypos = SCREEN_INFO.orig_video_lines;
current_ypos = SCREEN_INFO.orig_y; current_ypos = SCREEN_INFO.orig_y;
early_console = &early_vga_console; early_console = &early_vga_console;
} else if (!strncmp(buf, "simnow", 6)) { } else if (!strncmp(buf, "simnow", 6)) {
simnow_init(buf + 6); simnow_init(buf + 6);
early_console = &simnow_console; early_console = &simnow_console;
keep_early = 1; keep_early = 1;
} }
early_console_initialized = 1; early_console_initialized = 1;
register_console(early_console); register_console(early_console);
return 0; return 0;
} }
void __init disable_early_printk(void) void __init disable_early_printk(void)
{ {
if (!early_console_initialized || !early_console) if (!early_console_initialized || !early_console)
return; return;
if (!keep_early) { if (!keep_early) {
printk("disabling early console\n"); printk("disabling early console\n");
unregister_console(early_console); unregister_console(early_console);
early_console_initialized = 0; early_console_initialized = 0;
} else { } else {
printk("keeping early console\n"); printk("keeping early console\n");
} }
} }
__setup("earlyprintk=", setup_early_printk); __setup("earlyprintk=", setup_early_printk);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment