hpet: remove unnecessary variable "index"
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9eb7fad354
commit
5895879aca
@ -437,12 +437,12 @@ static uint64_t hpet_ram_read(void *opaque, hwaddr addr,
|
|||||||
unsigned size)
|
unsigned size)
|
||||||
{
|
{
|
||||||
HPETState *s = opaque;
|
HPETState *s = opaque;
|
||||||
uint64_t cur_tick, index;
|
uint64_t cur_tick;
|
||||||
|
|
||||||
trace_hpet_ram_read(addr);
|
trace_hpet_ram_read(addr);
|
||||||
index = addr;
|
|
||||||
/*address range of all TN regs*/
|
/*address range of all TN regs*/
|
||||||
if (index >= 0x100 && index <= 0x3ff) {
|
if (addr >= 0x100 && addr <= 0x3ff) {
|
||||||
uint8_t timer_id = (addr - 0x100) / 0x20;
|
uint8_t timer_id = (addr - 0x100) / 0x20;
|
||||||
HPETTimer *timer = &s->timer[timer_id];
|
HPETTimer *timer = &s->timer[timer_id];
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ static uint64_t hpet_ram_read(void *opaque, hwaddr addr,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (index) {
|
switch (addr) {
|
||||||
case HPET_ID:
|
case HPET_ID:
|
||||||
return s->capability;
|
return s->capability;
|
||||||
case HPET_PERIOD:
|
case HPET_PERIOD:
|
||||||
@ -510,15 +510,14 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
HPETState *s = opaque;
|
HPETState *s = opaque;
|
||||||
uint64_t old_val, new_val, val, index;
|
uint64_t old_val, new_val, val;
|
||||||
|
|
||||||
trace_hpet_ram_write(addr, value);
|
trace_hpet_ram_write(addr, value);
|
||||||
index = addr;
|
|
||||||
old_val = hpet_ram_read(opaque, addr, 4);
|
old_val = hpet_ram_read(opaque, addr, 4);
|
||||||
new_val = value;
|
new_val = value;
|
||||||
|
|
||||||
/*address range of all TN regs*/
|
/*address range of all TN regs*/
|
||||||
if (index >= 0x100 && index <= 0x3ff) {
|
if (addr >= 0x100 && addr <= 0x3ff) {
|
||||||
uint8_t timer_id = (addr - 0x100) / 0x20;
|
uint8_t timer_id = (addr - 0x100) / 0x20;
|
||||||
HPETTimer *timer = &s->timer[timer_id];
|
HPETTimer *timer = &s->timer[timer_id];
|
||||||
|
|
||||||
@ -620,7 +619,7 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
switch (index) {
|
switch (addr) {
|
||||||
case HPET_ID:
|
case HPET_ID:
|
||||||
return;
|
return;
|
||||||
case HPET_CFG:
|
case HPET_CFG:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user