q35: mch: cleanup MCH_HOST_BRIDGE_F_SMBASE_LCK usage in mch_update_smbase_smram()
PATCH 1/1 q35: mch: cleanup MCH_HOST_BRIDGE_F_SMBASE_LCK usage in mch_update_smbase_smram()
evaluate *reg & MCH_HOST_BRIDGE_F_SMBASE_LCK once into lck and then use lck afterwards.
Suggested-by "Michael S. Tsirkin" <[email protected]>
Signed-off-by Igor Mammedov <[email protected]>
--- hw/pci-host/q35.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/pci-host/q35.c +2 -2
@@ -444,13 +444,13 @@ static void mch_update_smbase_smram(MCHPCIState *mch) pd->wmask[MCH_HOST_BRIDGE_F_SMBASE ] =MCH_HOST_BRIDGE_F_SMBASE_LCK ;return ; } -if (*reg &MCH_HOST_BRIDGE_F_SMBASE_LCK ) { + lck = *reg &MCH_HOST_BRIDGE_F_SMBASE_LCK ; +if (lck) {/* lock register at 0x2 and disable all writes */ pd->wmask[MCH_HOST_BRIDGE_F_SMBASE ] =0 ; *reg =MCH_HOST_BRIDGE_F_SMBASE_LCK ; } - lck = *reg &MCH_HOST_BRIDGE_F_SMBASE_LCK ;memory_region_transaction_begin ();memory_region_set_enabled (&mch->smbase_blackhole, lck);memory_region_set_enabled (&mch->smbase_window, lck);
Signature · 1 line
2.47.3