aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2005-07-07 20:56:26 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:40 -0400
commit70b234a40107596a713e9981c643f2717e31463f (patch)
treee7f0d4382c32b61efd671c051095535767288a30 /arch/ppc64
parent030ffad23fb28fc29608a3bc21f0c3b88bf28592 (diff)
[PATCH] hvc_console: Separate the NUL character filtering from get_hvc_chars
Separate the NUL character filtering from get_hvc_chars. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc64')
-rw-r--r--arch/ppc64/kernel/hvconsole.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/arch/ppc64/kernel/hvconsole.c b/arch/ppc64/kernel/hvconsole.c
index 9d8876d92eb9..138e128a3886 100644
--- a/arch/ppc64/kernel/hvconsole.c
+++ b/arch/ppc64/kernel/hvconsole.c
@@ -41,29 +41,14 @@ int hvc_get_chars(uint32_t vtermno, char *buf, int count)
41 unsigned long got; 41 unsigned long got;
42 42
43 if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got, 43 if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
44 (unsigned long *)buf, (unsigned long *)buf+1) == H_Success) { 44 (unsigned long *)buf, (unsigned long *)buf+1) == H_Success)
45 /*
46 * Work around a HV bug where it gives us a null
47 * after every \r. -- paulus
48 */
49 if (got > 0) {
50 int i;
51 for (i = 1; i < got; ++i) {
52 if (buf[i] == 0 && buf[i-1] == '\r') {
53 --got;
54 if (i < got)
55 memmove(&buf[i], &buf[i+1],
56 got - i);
57 }
58 }
59 }
60 return got; 45 return got;
61 }
62 return 0; 46 return 0;
63} 47}
64 48
65EXPORT_SYMBOL(hvc_get_chars); 49EXPORT_SYMBOL(hvc_get_chars);
66 50
51
67/** 52/**
68 * hvc_put_chars: send characters to firmware for denoted vterm adapter 53 * hvc_put_chars: send characters to firmware for denoted vterm adapter
69 * @vtermno: The vtermno or unit_address of the adapter from which the data 54 * @vtermno: The vtermno or unit_address of the adapter from which the data