[PATCH] user: Mark cpu_loop() with noreturn attribute

Philippe Mathieu-Daudé posted 1 patch 2 years, 7 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210905000429.1097336-1-f4bug@amsat.org
There is a newer version of this series
bsd-user/qemu.h   | 2 +-
linux-user/qemu.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[PATCH] user: Mark cpu_loop() with noreturn attribute
Posted by Philippe Mathieu-Daudé 2 years, 7 months ago
cpu_loop() never exits, so mark it with QEMU_NORETURN.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 bsd-user/qemu.h   | 2 +-
 linux-user/qemu.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index c02e8a5ca1a..05bee7aefe5 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -155,7 +155,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1,
                             abi_long arg5, abi_long arg6);
 void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 extern THREAD CPUState *thread_cpu;
-void cpu_loop(CPUArchState *env);
+void QEMU_NORETURN cpu_loop(CPUArchState *env);
 char *target_strerror(int err);
 int get_osversion(void);
 void fork_start(void);
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 3b0b6b75fe8..5b2c764ae78 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -236,7 +236,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
                     abi_long arg5, abi_long arg6, abi_long arg7,
                     abi_long arg8);
 extern __thread CPUState *thread_cpu;
-void cpu_loop(CPUArchState *env);
+void QEMU_NORETURN cpu_loop(CPUArchState *env);
 const char *target_strerror(int err);
 int get_osversion(void);
 void init_qemu_uname_release(void);
-- 
2.31.1

Re: [PATCH] user: Mark cpu_loop() with noreturn attribute
Posted by Richard Henderson 2 years, 7 months ago
On 9/5/21 2:04 AM, Philippe Mathieu-Daudé wrote:
> cpu_loop() never exits, so mark it with QEMU_NORETURN.
> 
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   bsd-user/qemu.h   | 2 +-
>   linux-user/qemu.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

Re: [PATCH] user: Mark cpu_loop() with noreturn attribute
Posted by Bin Meng 2 years, 7 months ago
On Sun, Sep 5, 2021 at 8:18 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> cpu_loop() never exits, so mark it with QEMU_NORETURN.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  bsd-user/qemu.h   | 2 +-
>  linux-user/qemu.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Re: [PATCH] user: Mark cpu_loop() with noreturn attribute
Posted by Richard Henderson 2 years, 7 months ago
On 9/4/21 5:04 PM, Philippe Mathieu-Daudé wrote:
> cpu_loop() never exits, so mark it with QEMU_NORETURN.
> 
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   bsd-user/qemu.h   | 2 +-
>   linux-user/qemu.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)

Queued, thanks.

r~

Re: [PATCH] user: Mark cpu_loop() with noreturn attribute
Posted by Warner Losh 2 years, 7 months ago
On Sat, Sep 4, 2021 at 6:04 PM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:

> cpu_loop() never exits, so mark it with QEMU_NORETURN.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  bsd-user/qemu.h   | 2 +-
>  linux-user/qemu.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-By: Warner Losh <imp@bsdimp.com>


diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
> index c02e8a5ca1a..05bee7aefe5 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -155,7 +155,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num,
> abi_long arg1,
>                              abi_long arg5, abi_long arg6);
>  void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
>  extern THREAD CPUState *thread_cpu;
> -void cpu_loop(CPUArchState *env);
> +void QEMU_NORETURN cpu_loop(CPUArchState *env);
>  char *target_strerror(int err);
>  int get_osversion(void);
>  void fork_start(void);
> diff --git a/linux-user/qemu.h b/linux-user/qemu.h
> index 3b0b6b75fe8..5b2c764ae78 100644
> --- a/linux-user/qemu.h
> +++ b/linux-user/qemu.h
> @@ -236,7 +236,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
> arg1,
>                      abi_long arg5, abi_long arg6, abi_long arg7,
>                      abi_long arg8);
>  extern __thread CPUState *thread_cpu;
> -void cpu_loop(CPUArchState *env);
> +void QEMU_NORETURN cpu_loop(CPUArchState *env);
>  const char *target_strerror(int err);
>  int get_osversion(void);
>  void init_qemu_uname_release(void);
> --
> 2.31.1
>
>