mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 17:06:48 +07:00
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>
This commit is contained in:
parent
01b0e07e60
commit
a0a96ee9ba
@ -40,10 +40,16 @@
|
|||||||
*/
|
*/
|
||||||
int hvc_get_chars(uint32_t vtermno, char *buf, int count)
|
int hvc_get_chars(uint32_t vtermno, char *buf, int count)
|
||||||
{
|
{
|
||||||
unsigned long got;
|
long ret;
|
||||||
|
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
|
||||||
|
unsigned long *lbuf = (unsigned long *)buf;
|
||||||
|
|
||||||
if (plpar_get_term_char(vtermno, &got, buf) == H_SUCCESS)
|
ret = plpar_hcall(H_GET_TERM_CHAR, retbuf, vtermno);
|
||||||
return got;
|
lbuf[0] = retbuf[1];
|
||||||
|
lbuf[1] = retbuf[2];
|
||||||
|
|
||||||
|
if (ret == H_SUCCESS)
|
||||||
|
return retbuf[0];
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -256,30 +256,6 @@ static inline long plpar_tce_stuff(unsigned long liobn, unsigned long ioba,
|
|||||||
return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count);
|
return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline long plpar_get_term_char(unsigned long termno,
|
|
||||||
unsigned long *len_ret, char *buf_ret)
|
|
||||||
{
|
|
||||||
long rc;
|
|
||||||
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
|
|
||||||
unsigned long *lbuf = (unsigned long *)buf_ret; /* TODO: alignment? */
|
|
||||||
|
|
||||||
rc = plpar_hcall(H_GET_TERM_CHAR, retbuf, termno);
|
|
||||||
|
|
||||||
*len_ret = retbuf[0];
|
|
||||||
lbuf[0] = retbuf[1];
|
|
||||||
lbuf[1] = retbuf[2];
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline long plpar_put_term_char(unsigned long termno, unsigned long len,
|
|
||||||
const char *buffer)
|
|
||||||
{
|
|
||||||
unsigned long *lbuf = (unsigned long *)buffer; /* TODO: alignment? */
|
|
||||||
return plpar_hcall_norets(H_PUT_TERM_CHAR, termno, len, lbuf[0],
|
|
||||||
lbuf[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set various resource mode parameters */
|
/* Set various resource mode parameters */
|
||||||
static inline long plpar_set_mode(unsigned long mflags, unsigned long resource,
|
static inline long plpar_set_mode(unsigned long mflags, unsigned long resource,
|
||||||
unsigned long value1, unsigned long value2)
|
unsigned long value1, unsigned long value2)
|
||||||
|
Loading…
Reference in New Issue
Block a user