* Halil Pasic <pa...@linux.vnet.ibm.com> [2017-10-17 16:04:52 +0200]:
> Simplify the error handling of the HSCH. Let the code detecting the > condition tell (in a less ambiguous way) how it's to be handled. No > changes in behavior. > > Signed-off-by: Halil Pasic <pa...@linux.vnet.ibm.com> > --- > hw/s390x/css.c | 18 +++++------------- > include/hw/s390x/css.h | 2 +- > target/s390x/ioinst.c | 23 ++++------------------- > 3 files changed, 10 insertions(+), 33 deletions(-) > [...] > @@ -87,24 +85,11 @@ void ioinst_handle_hsch(S390CPU *cpu, uint64_t reg1) > } > trace_ioinst_sch_id("hsch", cssid, ssid, schid); > sch = css_find_subch(m, cssid, ssid, schid); > - if (sch && css_subch_visible(sch)) { > - ret = css_do_hsch(sch); > - } > - switch (ret) { > - case -ENODEV: > - cc = 3; > - break; > - case -EBUSY: > - cc = 2; > - break; > - case 0: > - cc = 0; > - break; > - default: > - cc = 1; > - break; > + if (!sch || !css_subch_visible(sch)) { > + setcc(cpu, 3); Ditto. > + return; > } > - setcc(cpu, cc); > + setcc(cpu, css_do_hsch(sch)); > } > > static int ioinst_schib_valid(SCHIB *schib) > -- > 2.13.5 > Reviewed-by: Dong Jia Shi <bjsdj...@linux.vnet.ibm.com> -- Dong Jia Shi