diff mbox

[06/15] lib/x86/smp: Fix compiler warnings

Message ID a3ffa2ff3ca66243b636b0f900ab3d3b7fc00133.1387187847.git.jan.kiszka@siemens.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Dec. 16, 2013, 9:57 a.m. UTC
Add missing include of desc.h for prototypes of setup_idt and
set_idt_entry and cast away the volatile of ipi_data - it's not volatile
while we run the IPI handler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 lib/x86/smp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Paolo Bonzini Dec. 17, 2013, 10:33 a.m. UTC | #1
Il 16/12/2013 10:57, Jan Kiszka ha scritto:
> Add missing include of desc.h for prototypes of setup_idt and
> set_idt_entry and cast away the volatile of ipi_data - it's not volatile
> while we run the IPI handler.

Why not?

Paolo

> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  lib/x86/smp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/x86/smp.c b/lib/x86/smp.c
> index d4c8106..75ac081 100644
> --- a/lib/x86/smp.c
> +++ b/lib/x86/smp.c
> @@ -3,6 +3,7 @@
>  #include "smp.h"
>  #include "apic.h"
>  #include "fwcfg.h"
> +#include "desc.h"
>  
>  #define IPI_VECTOR 0x20
>  
> @@ -18,7 +19,7 @@ static int _cpu_count;
>  static __attribute__((used)) void ipi()
>  {
>      void (*function)(void *data) = ipi_function;
> -    void *data = ipi_data;
> +    void *data = (void *)ipi_data;
>      bool wait = ipi_wait;
>  
>      if (!wait) {
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini Dec. 17, 2013, 10:35 a.m. UTC | #2
Il 16/12/2013 10:57, Jan Kiszka ha scritto:
> Add missing include of desc.h for prototypes of setup_idt and
> set_idt_entry and cast away the volatile of ipi_data - it's not volatile
> while we run the IPI handler.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

The right fix is to change the declaration from

  static volatile void *ipi_data;  // Pointer to volatile void

to

  static void *volatile ipi_data;  // Volatile pointer to void

Paolo


> ---
>  lib/x86/smp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/x86/smp.c b/lib/x86/smp.c
> index d4c8106..75ac081 100644
> --- a/lib/x86/smp.c
> +++ b/lib/x86/smp.c
> @@ -3,6 +3,7 @@
>  #include "smp.h"
>  #include "apic.h"
>  #include "fwcfg.h"
> +#include "desc.h"
>  
>  #define IPI_VECTOR 0x20
>  
> @@ -18,7 +19,7 @@ static int _cpu_count;
>  static __attribute__((used)) void ipi()
>  {
>      void (*function)(void *data) = ipi_function;
> -    void *data = ipi_data;
> +    void *data = (void *)ipi_data;
>      bool wait = ipi_wait;
>  
>      if (!wait) {
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/lib/x86/smp.c b/lib/x86/smp.c
index d4c8106..75ac081 100644
--- a/lib/x86/smp.c
+++ b/lib/x86/smp.c
@@ -3,6 +3,7 @@ 
 #include "smp.h"
 #include "apic.h"
 #include "fwcfg.h"
+#include "desc.h"
 
 #define IPI_VECTOR 0x20
 
@@ -18,7 +19,7 @@  static int _cpu_count;
 static __attribute__((used)) void ipi()
 {
     void (*function)(void *data) = ipi_function;
-    void *data = ipi_data;
+    void *data = (void *)ipi_data;
     bool wait = ipi_wait;
 
     if (!wait) {