openpic: unify gcr mode mask updates

The mode mask already masks out bits we don't care about, so the
actual handling code can stay intact regardless.

Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Alexander Graf 2013-01-07 20:15:28 +01:00
parent 7f11573b9f
commit 1ac3d71302

View File

@ -646,12 +646,14 @@ static inline void write_IRQreg_ivpr(OpenPICState *opp, int n_IRQ, uint32_t val)
static void openpic_gcr_write(OpenPICState *opp, uint64_t val)
{
if (val & GCR_RESET) {
openpic_reset(&opp->busdev.qdev);
} else if (opp->mpic_mode_mask) {
CPUArchState *env;
int mpic_proxy = 0;
if (val & GCR_RESET) {
openpic_reset(&opp->busdev.qdev);
return;
}
opp->gcr &= ~opp->mpic_mode_mask;
opp->gcr |= val & opp->mpic_mode_mask;
@ -663,7 +665,6 @@ static void openpic_gcr_write(OpenPICState *opp, uint64_t val)
env->mpic_proxy = mpic_proxy;
}
}
}
static void openpic_gbl_write(void *opaque, hwaddr addr, uint64_t val,
unsigned len)