Skip to contentSkip to conversation

q35: mch: cleanup MCH_HOST_BRIDGE_F_SMBASE_LCK usage in mch_update_smbase_smram()

PATCH New Igor Mammedov 1 participant 1 message Mar 4

lore
Share & tools
lore
#0 lore raw

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.

---
 hw/pci-host/q35.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/pci-host/q35.c +2 -2
index e85e4227b3..8c0404f3c5 100644
@@ -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