diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-17 16:19:42 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-01-30 06:50:18 -0500 |
commit | 382ac6b3fbc0ea6a5697fc6caaf7e7de12fa8b96 (patch) | |
tree | bdda012251f29775b2e1201f3b2b3e38c4680f42 /drivers/lguest/segments.c | |
parent | 934faab464c6a26ed1a226b6cf7111b35405dde1 (diff) |
lguest: get rid of lg variable assignments
We can save some lines of code by getting rid of
*lg = cpu... lines of code spread everywhere by now.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/segments.c')
-rw-r--r-- | drivers/lguest/segments.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/lguest/segments.c b/drivers/lguest/segments.c index 635f54c719ae..ec6aa3f1c36b 100644 --- a/drivers/lguest/segments.c +++ b/drivers/lguest/segments.c | |||
@@ -148,14 +148,13 @@ void copy_gdt(const struct lg_cpu *cpu, struct desc_struct *gdt) | |||
148 | * We copy it from the Guest and tweak the entries. */ | 148 | * We copy it from the Guest and tweak the entries. */ |
149 | void load_guest_gdt(struct lg_cpu *cpu, unsigned long table, u32 num) | 149 | void load_guest_gdt(struct lg_cpu *cpu, unsigned long table, u32 num) |
150 | { | 150 | { |
151 | struct lguest *lg = cpu->lg; | ||
152 | /* We assume the Guest has the same number of GDT entries as the | 151 | /* We assume the Guest has the same number of GDT entries as the |
153 | * Host, otherwise we'd have to dynamically allocate the Guest GDT. */ | 152 | * Host, otherwise we'd have to dynamically allocate the Guest GDT. */ |
154 | if (num > ARRAY_SIZE(cpu->arch.gdt)) | 153 | if (num > ARRAY_SIZE(cpu->arch.gdt)) |
155 | kill_guest(lg, "too many gdt entries %i", num); | 154 | kill_guest(cpu, "too many gdt entries %i", num); |
156 | 155 | ||
157 | /* We read the whole thing in, then fix it up. */ | 156 | /* We read the whole thing in, then fix it up. */ |
158 | __lgread(lg, cpu->arch.gdt, table, num * sizeof(cpu->arch.gdt[0])); | 157 | __lgread(cpu, cpu->arch.gdt, table, num * sizeof(cpu->arch.gdt[0])); |
159 | fixup_gdt_table(cpu, 0, ARRAY_SIZE(cpu->arch.gdt)); | 158 | fixup_gdt_table(cpu, 0, ARRAY_SIZE(cpu->arch.gdt)); |
160 | /* Mark that the GDT changed so the core knows it has to copy it again, | 159 | /* Mark that the GDT changed so the core knows it has to copy it again, |
161 | * even if the Guest is run on the same CPU. */ | 160 | * even if the Guest is run on the same CPU. */ |
@@ -169,9 +168,8 @@ void load_guest_gdt(struct lg_cpu *cpu, unsigned long table, u32 num) | |||
169 | void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls) | 168 | void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls) |
170 | { | 169 | { |
171 | struct desc_struct *tls = &cpu->arch.gdt[GDT_ENTRY_TLS_MIN]; | 170 | struct desc_struct *tls = &cpu->arch.gdt[GDT_ENTRY_TLS_MIN]; |
172 | struct lguest *lg = cpu->lg; | ||
173 | 171 | ||
174 | __lgread(lg, tls, gtls, sizeof(*tls)*GDT_ENTRY_TLS_ENTRIES); | 172 | __lgread(cpu, tls, gtls, sizeof(*tls)*GDT_ENTRY_TLS_ENTRIES); |
175 | fixup_gdt_table(cpu, GDT_ENTRY_TLS_MIN, GDT_ENTRY_TLS_MAX+1); | 173 | fixup_gdt_table(cpu, GDT_ENTRY_TLS_MIN, GDT_ENTRY_TLS_MAX+1); |
176 | /* Note that just the TLS entries have changed. */ | 174 | /* Note that just the TLS entries have changed. */ |
177 | cpu->changed |= CHANGED_GDT_TLS; | 175 | cpu->changed |= CHANGED_GDT_TLS; |