[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] pcie: pcie_cap_slot_write_config(): use correct macro
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH 1/4] pcie: pcie_cap_slot_write_config(): use correct macro |
Date: |
Tue, 7 Feb 2023 15:09:18 +0300 |
PCI_EXP_SLTCTL_PIC_OFF is a value, and PCI_EXP_SLTCTL_PIC is a mask.
Happily PCI_EXP_SLTCTL_PIC_OFF is a maximum value for this mask and is
equal to the mask itself. Still the code looks like a bug. Let's make
it more reader-friendly.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
hw/pci/pcie.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 924fdabd15..82ef723983 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -770,9 +770,9 @@ void pcie_cap_slot_write_config(PCIDevice *dev,
* control of powered off slots before powering them on.
*/
if ((sltsta & PCI_EXP_SLTSTA_PDS) && (val & PCI_EXP_SLTCTL_PCC) &&
- (val & PCI_EXP_SLTCTL_PIC_OFF) == PCI_EXP_SLTCTL_PIC_OFF &&
+ (val & PCI_EXP_SLTCTL_PIC) == PCI_EXP_SLTCTL_PIC_OFF &&
(!(old_slt_ctl & PCI_EXP_SLTCTL_PCC) ||
- (old_slt_ctl & PCI_EXP_SLTCTL_PIC_OFF) != PCI_EXP_SLTCTL_PIC_OFF)) {
+ (old_slt_ctl & PCI_EXP_SLTCTL_PIC) != PCI_EXP_SLTCTL_PIC_OFF)) {
pcie_cap_slot_do_unplug(dev);
}
pcie_cap_update_power(dev);
--
2.34.1
- [PATCH 1/4] pcie: pcie_cap_slot_write_config(): use correct macro, (continued)
- [PATCH 1/4] pcie: pcie_cap_slot_write_config(): use correct macro, Vladimir Sementsov-Ogievskiy, 2023/02/04
- [PATCH 4/4] pcie: add trace-point for power indicator transitions, Vladimir Sementsov-Ogievskiy, 2023/02/04
- [PATCH 2/4] pcie_regs: drop duplicated indicator value macros, Vladimir Sementsov-Ogievskiy, 2023/02/04
- [PATCH 4/4] pcie: add trace-poing for power indicator transitions, Vladimir Sementsov-Ogievskiy, 2023/02/04
- [PATCH 0/4] pcie: cleanup code and add trace point, Vladimir Sementsov-Ogievskiy, 2023/02/07
- [PATCH 1/4] pcie: pcie_cap_slot_write_config(): use correct macro,
Vladimir Sementsov-Ogievskiy <=
- [PATCH 4/4] pcie: add trace-poing for power indicator transitions, Vladimir Sementsov-Ogievskiy, 2023/02/07
- [PATCH 4/4] pcie: add trace-point for power indicator transitions, Vladimir Sementsov-Ogievskiy, 2023/02/07
- [PATCH 2/4] pcie_regs: drop duplicated indicator value macros, Vladimir Sementsov-Ogievskiy, 2023/02/07
- [PATCH 3/4] pcie: drop unused PCIExpressIndicator, Vladimir Sementsov-Ogievskiy, 2023/02/07
- Re: [PATCH 0/4] pcie: cleanup code and add trace point DROP THIS, Vladimir Sementsov-Ogievskiy, 2023/02/07