diff options
author | Anton Blanchard <anton@samba.org> | 2013-08-06 12:01:23 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-08-13 21:50:23 -0400 |
commit | a0a96ee9ba9ea188dee9126dbb404ff6253318cd (patch) | |
tree | 88183d79128d13443ba872be6575adab254348ca | |
parent | 01b0e07e603b1f2c589f841cf73eb80a4a06cde4 (diff) |
powerpc/pseries: Simplify H_GET_TERM_CHAR
plpar_get_term_char is only used once and just adds a layer
of complexity to H_GET_TERM_CHAR. plpar_put_term_char isn't
used at all so we can remove it.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/hvconsole.c | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/plpar_wrappers.h | 24 |
2 files changed, 9 insertions, 27 deletions
diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c index b344f94b0400..aa0aa37a4fd0 100644 --- a/arch/powerpc/platforms/pseries/hvconsole.c +++ b/arch/powerpc/platforms/pseries/hvconsole.c | |||
@@ -40,10 +40,16 @@ | |||
40 | */ | 40 | */ |
41 | int hvc_get_chars(uint32_t vtermno, char *buf, int count) | 41 | int hvc_get_chars(uint32_t vtermno, char *buf, int count) |
42 | { | 42 | { |
43 | unsigned long got; | 43 | long ret; |
44 | unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; | ||
45 | unsigned long *lbuf = (unsigned long *)buf; | ||
46 | |||
47 | ret = plpar_hcall(H_GET_TERM_CHAR, retbuf, vtermno); | ||
48 | lbuf[0] = retbuf[1]; | ||
49 | lbuf[1] = retbuf[2]; | ||
44 | 50 | ||
45 | if (plpar_get_term_char(vtermno, &got, buf) == H_SUCCESS) | 51 | if (ret == H_SUCCESS) |
46 | return got; | 52 | return retbuf[0]; |
47 | 53 | ||
48 | return 0; | 54 | return 0; |
49 | } | 55 | } |
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index f35787b6a5e0..417d0bfa4510 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h | |||
@@ -256,30 +256,6 @@ static inline long plpar_tce_stuff(unsigned long liobn, unsigned long ioba, | |||
256 | return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count); | 256 | return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count); |
257 | } | 257 | } |
258 | 258 | ||
259 | static inline long plpar_get_term_char(unsigned long termno, | ||
260 | unsigned long *len_ret, char *buf_ret) | ||
261 | { | ||
262 | long rc; | ||
263 | unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; | ||
264 | unsigned long *lbuf = (unsigned long *)buf_ret; /* TODO: alignment? */ | ||
265 | |||
266 | rc = plpar_hcall(H_GET_TERM_CHAR, retbuf, termno); | ||
267 | |||
268 | *len_ret = retbuf[0]; | ||
269 | lbuf[0] = retbuf[1]; | ||
270 | lbuf[1] = retbuf[2]; | ||
271 | |||
272 | return rc; | ||
273 | } | ||
274 | |||
275 | static inline long plpar_put_term_char(unsigned long termno, unsigned long len, | ||
276 | const char *buffer) | ||
277 | { | ||
278 | unsigned long *lbuf = (unsigned long *)buffer; /* TODO: alignment? */ | ||
279 | return plpar_hcall_norets(H_PUT_TERM_CHAR, termno, len, lbuf[0], | ||
280 | lbuf[1]); | ||
281 | } | ||
282 | |||
283 | /* Set various resource mode parameters */ | 259 | /* Set various resource mode parameters */ |
284 | static inline long plpar_set_mode(unsigned long mflags, unsigned long resource, | 260 | static inline long plpar_set_mode(unsigned long mflags, unsigned long resource, |
285 | unsigned long value1, unsigned long value2) | 261 | unsigned long value1, unsigned long value2) |