diff mbox

[v2] translate-all: Marked map_exec() with the 'unused' attribute

Message ID 1415002312-30827-1-git-send-email-syeon.hwang@samsung.com
State New
Headers show

Commit Message

SeokYeon Hwang Nov. 3, 2014, 8:11 a.m. UTC
Marked map_exec() with the 'unused' attribute to avoid '-Wunused-function' on clang 3.4 or later.

Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
---
 translate-all.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peter Maydell Nov. 3, 2014, 3:03 p.m. UTC | #1
On 3 November 2014 08:11, SeokYeon Hwang <syeon.hwang@samsung.com> wrote:
> Marked map_exec() with the 'unused' attribute to avoid '-Wunused-function' on clang 3.4 or later.
>
> Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
> ---
>  translate-all.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/translate-all.c b/translate-all.c
> index ba5c840..9d150fb 100644
> --- a/translate-all.c
> +++ b/translate-all.c
> @@ -270,14 +270,14 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr)
>  }
>
>  #ifdef _WIN32
> -static inline void map_exec(void *addr, long size)
> +static __attribute__((unused)) void map_exec(void *addr, long size)
>  {
>      DWORD old_protect;
>      VirtualProtect(addr, size,
>                     PAGE_EXECUTE_READWRITE, &old_protect);
>  }
>  #else
> -static inline void map_exec(void *addr, long size)
> +static __attribute__((unused)) void map_exec(void *addr, long size)
>  {
>      unsigned long start, end, page_size;
>
> --
> 2.1.0

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Paolo Bonzini Nov. 5, 2014, 11:01 a.m. UTC | #2
On 03/11/2014 09:11, SeokYeon Hwang wrote:
> Marked map_exec() with the 'unused' attribute to avoid '-Wunused-function' on clang 3.4 or later.
> 
> Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>

Cc: qemu-trivial@nongnu.org
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

> ---
>  translate-all.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/translate-all.c b/translate-all.c
> index ba5c840..9d150fb 100644
> --- a/translate-all.c
> +++ b/translate-all.c
> @@ -270,14 +270,14 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr)
>  }
>  
>  #ifdef _WIN32
> -static inline void map_exec(void *addr, long size)
> +static __attribute__((unused)) void map_exec(void *addr, long size)
>  {
>      DWORD old_protect;
>      VirtualProtect(addr, size,
>                     PAGE_EXECUTE_READWRITE, &old_protect);
>  }
>  #else
> -static inline void map_exec(void *addr, long size)
> +static __attribute__((unused)) void map_exec(void *addr, long size)
>  {
>      unsigned long start, end, page_size;
>  
>
diff mbox

Patch

diff --git a/translate-all.c b/translate-all.c
index ba5c840..9d150fb 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -270,14 +270,14 @@  bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr)
 }
 
 #ifdef _WIN32
-static inline void map_exec(void *addr, long size)
+static __attribute__((unused)) void map_exec(void *addr, long size)
 {
     DWORD old_protect;
     VirtualProtect(addr, size,
                    PAGE_EXECUTE_READWRITE, &old_protect);
 }
 #else
-static inline void map_exec(void *addr, long size)
+static __attribute__((unused)) void map_exec(void *addr, long size)
 {
     unsigned long start, end, page_size;