From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:41448 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726332AbgGPIrK (ORCPT ); Thu, 16 Jul 2020 04:47:10 -0400 Subject: Re: [kvm-unit-tests PATCH v13 9/9] s390x: css: ssch/tsch with sense and interrupt References: <1594887809-10521-1-git-send-email-pmorel@linux.ibm.com> <1594887809-10521-10-git-send-email-pmorel@linux.ibm.com> From: Thomas Huth Message-ID: Date: Thu, 16 Jul 2020 10:46:57 +0200 MIME-Version: 1.0 In-Reply-To: <1594887809-10521-10-git-send-email-pmorel@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-s390-owner@vger.kernel.org List-ID: To: Pierre Morel , kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, cohuck@redhat.com, drjones@redhat.com On 16/07/2020 10.23, Pierre Morel wrote: > After a channel is enabled we start a SENSE_ID command using > the SSCH instruction to recognize the control unit and device. > > This tests the success of SSCH, the I/O interruption and the TSCH > instructions. > > The SENSE_ID command response is tested to report 0xff inside > its reserved field and to report the same control unit type > as the cu_type kernel argument. > > Without the cu_type kernel argument, the test expects a device > with a default control unit type of 0x3832, a.k.a virtio-net-ccw. > > Signed-off-by: Pierre Morel > --- [...] > +/* > + * css_residual_count > + * Return the residual count, if it is valid. > + * > + * Return value: > + * Success: the residual count > + * Not meaningful: -1 (-1 can not be a valid count) > + */ > +int css_residual_count(unsigned int schid) > +{ > + > + if (!(irb.scsw.ctrl & (SCSW_SC_PENDING | SCSW_SC_PRIMARY))) > + goto invalid; > + > + if (irb.scsw.dev_stat) > + if (irb.scsw.sch_stat & ~(SCSW_SCHS_PCI | SCSW_SCHS_IL)) > + goto invalid; > + > + return irb.scsw.count; > + > +invalid: > + return -1; > +} I still think this would look nicer without gotos. Anyway, Acked-by: Thomas Huth