Skip to contentSkip to conversation

someone screwed something up

DISCUSSION Rusty Russell 1 participant 1 message Mar 27, 2007 1 message not in the archive virtio core

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · Andrew Morton

arch/i386/lguest/lguest.c:496: warning: assignment from incompatible pointer type arch/i386/lguest/lguest.c:497: warning: assignment from incompatible pointer type arch/i386/lguest/lguest.c:498: warning: assignment from incompatible pointer type

        paravirt_ops.write_ldt_entry = lguest_write_ldt_entry;
        paravirt_ops.write_gdt_entry = lguest_write_gdt_entry;
        paravirt_ops.write_idt_entry = lguest_write_idt_entry;

And here it is:
==
The prototype for paravirt_ops write_lgt_entry, write_gdt_entry and write_idt_entry was type-corrected, so change lguest to match. We can also use the "write_dt_entry" which was exported by that same cleanup patch, rather than write our own.

arch/i386/lguest/lguest.c +10 -16
diff -r f52fef6a1f2d arch/i386/lguest/lguest.c
@@ -362,30 +362,24 @@ static void __init lguest_init_IRQ(void)
 	irq_ctx_init(smp_processor_id());
 }
 
-static inline void native_write_dt_entry(void *dt, int entry, u32 entry_low, u32 entry_high)
-{
-	u32 *lp = (u32 *)((char *)dt + entry*8);
-	lp[0] = entry_low;
-	lp[1] = entry_high;
-}
-
-static fastcall void lguest_write_ldt_entry(void *dt, int entrynum, u32 low, u32 high)
+static fastcall void lguest_write_ldt_entry(struct desc_struct *dt,
+					    int entrynum, u32 low, u32 high)
 {
 	/* FIXME: Allow this. */
 	BUG();
 }
 
-static fastcall void lguest_write_gdt_entry(void *dt, int entrynum,
-					   u32 low, u32 high)
-{
-	native_write_dt_entry(dt, entrynum, low, high);
+static fastcall void lguest_write_gdt_entry(struct desc_struct *dt,
+					    int entrynum, u32 low, u32 high)
+{
+	write_dt_entry(dt, entrynum, low, high);
 	hcall(LHCALL_LOAD_GDT, __pa(dt), GDT_ENTRIES, 0);
 }
 
-static fastcall void lguest_write_idt_entry(void *dt, int entrynum,
-					   u32 low, u32 high)
-{
-	native_write_dt_entry(dt, entrynum, low, high);
+static fastcall void lguest_write_idt_entry(struct desc_struct *dt,
+					    int entrynum, u32 low, u32 high)
+{
+	write_dt_entry(dt, entrynum, low, high);
 	hcall(LHCALL_LOAD_IDT_ENTRY, entrynum, low, high);
 }