All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Cleanup for xen/common/kexec.c
@ 2007-01-22  9:48 Christoph Egger
  2007-01-22 11:57 ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Egger @ 2007-01-22  9:48 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 80 bytes --]


Hi!

Attached patch avoids void * arithmetic in xen/common/kexec.c

Christoph


[-- Attachment #2: xen_kexec.diff --]
[-- Type: text/x-diff, Size: 1972 bytes --]

diff -r 7e28a8c150ed xen/common/kexec.c
--- a/xen/common/kexec.c	Sat Jan 20 14:33:43 2007 +0000
+++ b/xen/common/kexec.c	Mon Jan 22 10:28:22 2007 +0100
@@ -27,7 +27,7 @@ typedef long ret_t;
 typedef long ret_t;
 
 #define ELFNOTE_ALIGN(_n_) (((_n_)+3)&~3)
-#define ELFNOTE_NAME(_n_) ((void*)(_n_) + sizeof(*(_n_)))
+#define ELFNOTE_NAME(_n_) ((char*)(_n_) + sizeof(*(_n_)))
 #define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz))
 #define ELFNOTE_NEXT(_n_) (ELFNOTE_DESC(_n_) + ELFNOTE_ALIGN((_n_)->descsz))
 
@@ -75,10 +75,10 @@ void kexec_crash_save_cpu(void)
     if ( cpu_test_and_set(cpu, crash_saved_cpus) )
         return;
 
-    prstatus = ELFNOTE_DESC(note);
-
-    note = ELFNOTE_NEXT(note);
-    xencore = ELFNOTE_DESC(note);
+    prstatus = (ELF_Prstatus *)ELFNOTE_DESC(note);
+
+    note = (Elf_Note *)ELFNOTE_NEXT(note);
+    xencore = (crash_xen_core_t *)ELFNOTE_DESC(note);
 
     elf_core_save_regs(&prstatus->pr_reg, xencore);
 }
@@ -87,7 +87,7 @@ crash_xen_info_t *kexec_crash_save_info(
 crash_xen_info_t *kexec_crash_save_info(void)
 {
     int cpu = smp_processor_id();
-    crash_xen_info_t *info = ELFNOTE_DESC(xen_crash_note);
+    crash_xen_info_t *info = (crash_xen_info_t *)ELFNOTE_DESC(xen_crash_note);
 
     BUG_ON(!cpu_test_and_set(cpu, crash_saved_cpus));
 
@@ -191,13 +191,13 @@ static int kexec_get(cpu)(xen_kexec_rang
         setup_note(note, "CORE", NT_PRSTATUS, sizeof(ELF_Prstatus));
 
         /* Setup Xen CORE note. */
-        note = ELFNOTE_NEXT(note);
+        note = (Elf_Note *)ELFNOTE_NEXT(note);
         setup_note(note, "Xen", XEN_ELFNOTE_CRASH_REGS, sizeof(crash_xen_core_t));
 
         if (nr == 0)
         {
             /* Setup system wide Xen info note. */
-            xen_crash_note = note = ELFNOTE_NEXT(note);
+            xen_crash_note = note = (Elf_Note *)ELFNOTE_NEXT(note);
             setup_note(note, "Xen", XEN_ELFNOTE_CRASH_INFO, sizeof(crash_xen_info_t));
         }
     }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-22 15:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-22  9:48 [PATCH] Cleanup for xen/common/kexec.c Christoph Egger
2007-01-22 11:57 ` Ian Campbell
2007-01-22 14:08   ` Christoph Egger
2007-01-22 15:44     ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.