OSDN Git Service

spapr: Small fixes to rtas_ibm_get_system_parameter, remove rtas_st_buffer
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 19 Jan 2016 04:57:42 +0000 (15:57 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sat, 30 Jan 2016 12:37:36 +0000 (23:37 +1100)
commitc920f7b42fc7834bae73a5fd146f58db18bb3f58
tree3b1e3b1ba30e1f4b5ca6cb75a4400ace3e41713c
parentff57eae5f119ce2c6fbaab1313e3487969533fb9
spapr: Small fixes to rtas_ibm_get_system_parameter, remove rtas_st_buffer

rtas_st_buffer() appears in spapr.h as though it were a widely used helper,
but in fact it is only used for saving data in a format used by
rtas_ibm_get_system_parameter().  This changes it to a local helper more
specifically for that function.

While we're there fix a couple of small defects in
rtas_ibm_get_system_parameter:
  - For the string value SPLPAR_CHARACTERISTICS, it wasn't including the
    terminating \0 in the length which it should according to LoPAPR
    7.3.16.1
  - It now checks that the supplied buffer has at least enough space for
    the length of the returned data, and returns an error if it does not.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
hw/ppc/spapr_rtas.c
include/hw/ppc/spapr.h