aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/lguest_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/lguest/lguest_user.c')
-rw-r--r--drivers/lguest/lguest_user.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index ff4a0bc9904d..4263f4cc8c55 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -250,13 +250,13 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
250 */ 250 */
251static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip) 251static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
252{ 252{
253 /* We have a limited number the number of CPUs in the lguest struct. */ 253 /* We have a limited number of CPUs in the lguest struct. */
254 if (id >= ARRAY_SIZE(cpu->lg->cpus)) 254 if (id >= ARRAY_SIZE(cpu->lg->cpus))
255 return -EINVAL; 255 return -EINVAL;
256 256
257 /* Set up this CPU's id, and pointer back to the lguest struct. */ 257 /* Set up this CPU's id, and pointer back to the lguest struct. */
258 cpu->id = id; 258 cpu->id = id;
259 cpu->lg = container_of((cpu - id), struct lguest, cpus[0]); 259 cpu->lg = container_of(cpu, struct lguest, cpus[id]);
260 cpu->lg->nr_cpus++; 260 cpu->lg->nr_cpus++;
261 261
262 /* Each CPU has a timer it can set. */ 262 /* Each CPU has a timer it can set. */
@@ -270,7 +270,7 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
270 if (!cpu->regs_page) 270 if (!cpu->regs_page)
271 return -ENOMEM; 271 return -ENOMEM;
272 272
273 /* We actually put the registers at the bottom of the page. */ 273 /* We actually put the registers at the end of the page. */
274 cpu->regs = (void *)cpu->regs_page + PAGE_SIZE - sizeof(*cpu->regs); 274 cpu->regs = (void *)cpu->regs_page + PAGE_SIZE - sizeof(*cpu->regs);
275 275
276 /* 276 /*