aboutsummaryrefslogtreecommitdiff
path: root/hw/timer
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-07-10 10:31:48 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-07-22 19:19:44 +0200
commit5895879aca252f4ebb2d1078eaf836c61ec54e9b (patch)
tree3abad1dac35c4a04d23f186f1bc6c5deb7245dff /hw/timer
parent9eb7fad3546a89ee7cf0e90f5b1daccf89725cea (diff)
downloadqemu-5895879aca252f4ebb2d1078eaf836c61ec54e9b.zip
qemu-5895879aca252f4ebb2d1078eaf836c61ec54e9b.tar.gz
qemu-5895879aca252f4ebb2d1078eaf836c61ec54e9b.tar.bz2
hpet: remove unnecessary variable "index"
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/timer')
-rw-r--r--hw/timer/hpet.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index bbb1e5f..380e272 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -437,12 +437,12 @@ static uint64_t hpet_ram_read(void *opaque, hwaddr addr,
unsigned size)
{
HPETState *s = opaque;
- uint64_t cur_tick, index;
+ uint64_t cur_tick;
trace_hpet_ram_read(addr);
- index = addr;
+
/*address range of all TN regs*/
- if (index >= 0x100 && index <= 0x3ff) {
+ if (addr >= 0x100 && addr <= 0x3ff) {
uint8_t timer_id = (addr - 0x100) / 0x20;
HPETTimer *timer = &s->timer[timer_id];
@@ -469,7 +469,7 @@ static uint64_t hpet_ram_read(void *opaque, hwaddr addr,
break;
}
} else {
- switch (index) {
+ switch (addr) {
case HPET_ID:
return s->capability;
case HPET_PERIOD:
@@ -510,15 +510,14 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
{
int i;
HPETState *s = opaque;
- uint64_t old_val, new_val, val, index;
+ uint64_t old_val, new_val, val;
trace_hpet_ram_write(addr, value);
- index = addr;
old_val = hpet_ram_read(opaque, addr, 4);
new_val = value;
/*address range of all TN regs*/
- if (index >= 0x100 && index <= 0x3ff) {
+ if (addr >= 0x100 && addr <= 0x3ff) {
uint8_t timer_id = (addr - 0x100) / 0x20;
HPETTimer *timer = &s->timer[timer_id];
@@ -620,7 +619,7 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
}
return;
} else {
- switch (index) {
+ switch (addr) {
case HPET_ID:
return;
case HPET_CFG: