aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuy Martin <gmsoft@tuxicoman.be>2010-12-06 10:48:04 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-01-15 09:39:08 -0500
commitfbea668498e93bb38ac9226c7af9120a25957375 (patch)
treece720ab33c5bb1d756a9b54f1437eca39c70a2d1 /arch
parent38567333a6dabd0f2b4150e9fb6dd8e3ba2985e5 (diff)
parisc : Remove broken line wrapping handling pdc_iodc_print()
Remove the broken line wrapping handling in pdc_iodc_print(). It is broken in 3 ways : - It doesn't keep track of the current screen position, it just assumes that the new buffer will be printed at the begining of the screen. - It doesn't take in account that non printable characters won't increase the current position on the screen. - And last but not least, it triggers a kernel panic if a backspace is the first char in the provided buffer : Backtrace: [<0000000040128ec4>] pdc_console_write+0x44/0x78 [<0000000040128f18>] pdc_console_tty_write+0x20/0x38 [<000000004032f1ac>] n_tty_write+0x2a4/0x550 [<000000004032b158>] tty_write+0x1e0/0x2d8 [<00000000401bb420>] vfs_write+0xb8/0x188 [<00000000401bb630>] sys_write+0x68/0xb8 [<0000000040104eb8>] syscall_exit+0x0/0x14 Most terminals handle the line wrapping just fine. I've confirmed that it works correctly on a C8000 with both vga and serial output. Signed-off-by: Guy Martin <gmsoft@tuxicoman.be> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/kernel/firmware.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index df971fa0c32f..4896ed090585 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -1126,15 +1126,13 @@ int pdc_iodc_print(const unsigned char *str, unsigned count)
1126 unsigned int i; 1126 unsigned int i;
1127 unsigned long flags; 1127 unsigned long flags;
1128 1128
1129 for (i = 0; i < count && i < 79;) { 1129 for (i = 0; i < count;) {
1130 switch(str[i]) { 1130 switch(str[i]) {
1131 case '\n': 1131 case '\n':
1132 iodc_dbuf[i+0] = '\r'; 1132 iodc_dbuf[i+0] = '\r';
1133 iodc_dbuf[i+1] = '\n'; 1133 iodc_dbuf[i+1] = '\n';
1134 i += 2; 1134 i += 2;
1135 goto print; 1135 goto print;
1136 case '\b': /* BS */
1137 i--; /* overwrite last */
1138 default: 1136 default:
1139 iodc_dbuf[i] = str[i]; 1137 iodc_dbuf[i] = str[i];
1140 i++; 1138 i++;
@@ -1142,15 +1140,6 @@ int pdc_iodc_print(const unsigned char *str, unsigned count)
1142 } 1140 }
1143 } 1141 }
1144 1142
1145 /* if we're at the end of line, and not already inserting a newline,
1146 * insert one anyway. iodc console doesn't claim to support >79 char
1147 * lines. don't account for this in the return value.
1148 */
1149 if (i == 79 && iodc_dbuf[i-1] != '\n') {
1150 iodc_dbuf[i+0] = '\r';
1151 iodc_dbuf[i+1] = '\n';
1152 }
1153
1154print: 1143print:
1155 spin_lock_irqsave(&pdc_lock, flags); 1144 spin_lock_irqsave(&pdc_lock, flags);
1156 real32_call(PAGE0->mem_cons.iodc_io, 1145 real32_call(PAGE0->mem_cons.iodc_io,