public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>, Janosch Frank <frankja@linux.ibm.com>
Cc: Janis Schoetterl-Glausch <scgl@linux.ibm.com>,
	Pierre Morel <pmorel@linux.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [kvm-unit-tests PATCH v2 1/2] s390x: Remove assert from arch_def.h
Date: Tue,  5 Oct 2021 11:11:52 +0200	[thread overview]
Message-ID: <20211005091153.1863139-2-scgl@linux.ibm.com> (raw)
In-Reply-To: <20211005091153.1863139-1-scgl@linux.ibm.com>

Do not use asserts in arch_def.h so it can be included by snippets.
The caller in stsi.c does not need to be adjusted, returning -1 causes
the test to fail.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
---
 lib/s390x/asm/arch_def.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
index 302ef1f..4167e2b 100644
--- a/lib/s390x/asm/arch_def.h
+++ b/lib/s390x/asm/arch_def.h
@@ -334,7 +334,7 @@ static inline int stsi(void *addr, int fc, int sel1, int sel2)
 	return cc;
 }
 
-static inline unsigned long stsi_get_fc(void)
+static inline int stsi_get_fc(void)
 {
 	register unsigned long r0 asm("0") = 0;
 	register unsigned long r1 asm("1") = 0;
@@ -346,7 +346,8 @@ static inline unsigned long stsi_get_fc(void)
 		     : "+d" (r0), [cc] "=d" (cc)
 		     : "d" (r1)
 		     : "cc", "memory");
-	assert(!cc);
+	if (cc != 0)
+		return -1;
 	return r0 >> 28;
 }
 
-- 
2.31.1


       reply	other threads:[~2021-10-05  9:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211005091153.1863139-1-scgl@linux.ibm.com>
2021-10-05  9:11 ` Janis Schoetterl-Glausch [this message]
2021-10-05 11:19   ` [kvm-unit-tests PATCH v2 1/2] [kvm-unit-tests PATCH v2 0/2] Test specification exception Janis Schoetterl-Glausch
2021-10-05 12:46   ` [kvm-unit-tests PATCH v2 1/2] s390x: Remove assert from arch_def.h Claudio Imbrenda
2021-10-05 12:51   ` Janosch Frank
2021-10-05 13:51     ` Janis Schoetterl-Glausch
2021-10-05 13:56       ` Janosch Frank
2021-10-05  9:11 ` [kvm-unit-tests PATCH v2 2/2] s390x: Add specification exception interception test Janis Schoetterl-Glausch
2021-10-05 13:09   ` Claudio Imbrenda
2021-10-05 14:12     ` Janis Schoetterl-Glausch
     [not found]   ` <d49ea774-2e3b-aea7-6c7a-9dd3cc744283@linux.ibm.com>
2021-10-05 14:34     ` Janis Schoetterl-Glausch
2021-10-05 16:52   ` Thomas Huth
2021-10-06  9:47     ` Janosch Frank

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211005091153.1863139-2-scgl@linux.ibm.com \
    --to=scgl@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pmorel@linux.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox