From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com ([205.139.110.61]:59837 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728217AbgFJPyl (ORCPT ); Wed, 10 Jun 2020 11:54:41 -0400 Date: Wed, 10 Jun 2020 17:54:29 +0200 From: Cornelia Huck Subject: Re: [kvm-unit-tests PATCH v8 10/12] s390x: css: stsch, enumeration test Message-ID: <20200610175429.401a58ea.cohuck@redhat.com> In-Reply-To: References: <1591603981-16879-1-git-send-email-pmorel@linux.ibm.com> <1591603981-16879-11-git-send-email-pmorel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-s390-owner@vger.kernel.org List-ID: To: Pierre Morel Cc: Thomas Huth , kvm@vger.kernel.org, linux-s390@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com On Tue, 9 Jun 2020 14:20:35 +0200 Pierre Morel wrote: > On 2020-06-09 09:39, Thomas Huth wrote: > > On 08/06/2020 10.12, Pierre Morel wrote: > >> +static void test_enumerate(void) > >> +{ > >> + test_device_sid = css_enumerate(); > >> + if (test_device_sid & SCHID_ONE) { > >> + report(1, "First device schid: 0x%08x", test_device_sid); > >> + return; > >> + } > >> + > >> + switch (test_device_sid) { > >> + case 0: > >> + report (0, "No I/O device found"); > >> + break; > >> + default: /* 1 or 2 should never happened for STSCH */ > >> + report(0, "Unexpected cc=%d during enumeration", > >> + test_device_sid); > >> + return; > >> + } > > > > Ok, so here is now the test failure for the cc=1 or 2 that should never > > happen. That means currently you print out the CC for this error twice. > > One time should be enough, either here, or use an report_abort() in the > > css_enumerate(), I'd say. > > > > Anyway, can you please replace this switch statement with a "if > > (!test_device_sid)" instead? Or do you plan to add more "case" > > statements later? > > I will use the repor_abort() in the css_enumerate() so there > is only two case, I find a channel or not, so I don't even need the > second if :) . Yeah, testing only for SCHID_ONE present or not makes this a lot less confusing.