diff mbox series

[kvm-unit-tests] lib/s390x/io: Make sure that exit() is not returning

Message ID 1537858200-15083-1-git-send-email-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests] lib/s390x/io: Make sure that exit() is not returning | expand

Commit Message

Thomas Huth Sept. 25, 2018, 6:50 a.m. UTC
Since commit 96d79976f779589 kvm-unit-tests can not be compiled on
s390x anymore. The compiler complains:

lib/s390x/io.c: In function ‘exit’:
lib/s390x/io.c:57:1: error: ‘noreturn’ function does return [-Werror]

Let's make sure that the function can really not return anymore
(i.e. also do not return anymore in case SIGP is broken for example).

Fixes: 96d79976f779589bbdbb24474de8fd214b179d7e
Reported-by: Lukáš Doktor <ldoktor@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 lib/s390x/io.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Lukáš Doktor Sept. 25, 2018, 7:11 a.m. UTC | #1
Dne 25. 09. 18 v 8:50 Thomas Huth napsal(a):
> Since commit 96d79976f779589 kvm-unit-tests can not be compiled on
> s390x anymore. The compiler complains:
> 
> lib/s390x/io.c: In function ‘exit’:
> lib/s390x/io.c:57:1: error: ‘noreturn’ function does return [-Werror]
> 
> Let's make sure that the function can really not return anymore
> (i.e. also do not return anymore in case SIGP is broken for example).
> 
> Fixes: 96d79976f779589bbdbb24474de8fd214b179d7e
> Reported-by: Lukáš Doktor <ldoktor@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  lib/s390x/io.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/io.c b/lib/s390x/io.c
> index 17d5fc7..7bca637 100644
> --- a/lib/s390x/io.c
> +++ b/lib/s390x/io.c
> @@ -51,5 +51,7 @@ void setup(void)
>  void exit(int code)
>  {
>  	printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
> -	sigp_stop();
> +	while (1) {
> +		sigp_stop();
> +	}
>  }
> 

Yep, "make" complains without this patch and works well with it. Also tests PASS/SKIP with this patch.

Reviewed-by: Lukáš Doktor <ldoktor@redhat.com>
David Hildenbrand Sept. 25, 2018, 7:41 a.m. UTC | #2
On 25/09/2018 08:50, Thomas Huth wrote:
> Since commit 96d79976f779589 kvm-unit-tests can not be compiled on
> s390x anymore. The compiler complains:
> 
> lib/s390x/io.c: In function ‘exit’:
> lib/s390x/io.c:57:1: error: ‘noreturn’ function does return [-Werror]
> 
> Let's make sure that the function can really not return anymore
> (i.e. also do not return anymore in case SIGP is broken for example).
> 
> Fixes: 96d79976f779589bbdbb24474de8fd214b179d7e
> Reported-by: Lukáš Doktor <ldoktor@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  lib/s390x/io.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/io.c b/lib/s390x/io.c
> index 17d5fc7..7bca637 100644
> --- a/lib/s390x/io.c
> +++ b/lib/s390x/io.c
> @@ -51,5 +51,7 @@ void setup(void)
>  void exit(int code)
>  {
>  	printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
> -	sigp_stop();
> +	while (1) {
> +		sigp_stop();
> +	}
>  }
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
Paolo Bonzini Oct. 1, 2018, 8:23 a.m. UTC | #3
On 25/09/2018 08:50, Thomas Huth wrote:
> Since commit 96d79976f779589 kvm-unit-tests can not be compiled on
> s390x anymore. The compiler complains:
> 
> lib/s390x/io.c: In function ‘exit’:
> lib/s390x/io.c:57:1: error: ‘noreturn’ function does return [-Werror]
> 
> Let's make sure that the function can really not return anymore
> (i.e. also do not return anymore in case SIGP is broken for example).
> 
> Fixes: 96d79976f779589bbdbb24474de8fd214b179d7e
> Reported-by: Lukáš Doktor <ldoktor@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  lib/s390x/io.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/io.c b/lib/s390x/io.c
> index 17d5fc7..7bca637 100644
> --- a/lib/s390x/io.c
> +++ b/lib/s390x/io.c
> @@ -51,5 +51,7 @@ void setup(void)
>  void exit(int code)
>  {
>  	printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
> -	sigp_stop();
> +	while (1) {
> +		sigp_stop();
> +	}
>  }
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/lib/s390x/io.c b/lib/s390x/io.c
index 17d5fc7..7bca637 100644
--- a/lib/s390x/io.c
+++ b/lib/s390x/io.c
@@ -51,5 +51,7 @@  void setup(void)
 void exit(int code)
 {
 	printf("\nEXIT: STATUS=%d\n", ((code) << 1) | 1);
-	sigp_stop();
+	while (1) {
+		sigp_stop();
+	}
 }