Skip to contentSkip to conversation

PCI/ERR: Fix state assignment

PATCH In review Keith Busch 2 participants 3 messages Feb 10, 2021 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/ERR: Fix state assignment

The state was intended to be assigned rather than compared for equality.

Fixes 8fae7d8809b815148 ("PCI/ERR: Simplify pci_dev_set_io_state()")
Cc Bjorn Helgass <[email protected]>
---
 drivers/pci/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci.h +1 -1
index db267120c962..1e4e4cb48bab 100644
@@ -345,7 +345,7 @@ static inline bool pci_dev_set_io_state(struct pci_dev *dev,
 
 	/* Can always put a device in perm_failure state */
 	if (new == pci_channel_io_perm_failure) {
-		dev->error_state == pci_channel_io_perm_failure;
+		dev->error_state = pci_channel_io_perm_failure;
 		return true;
 	}
 
Signature · 1 line
2.25.4
Reviewed-by on v1 1/1
#1 lore raw

Hi Keith,

[...]

drivers/pci/pci.h static inline bool pci_dev_set_io_state(struct pci_dev *dev, · line 348

Quoted 3 lines
drivers/pci/pci.h +1 -1
 	if (new == pci_channel_io_perm_failure) {
-		dev->error_state == pci_channel_io_perm_failure;
+		dev->error_state = pci_channel_io_perm_failure;

[...]

Ouch! Nice catch.

Krzysztof

#2 lore raw
Quoted 9 lines · Krzysztof Wilczyński

Hi Keith,

[...]

drivers/pci/pci.h static inline bool pci_dev_set_io_state(struct pci_dev *dev, · line 348

Quoted 3 lines
drivers/pci/pci.h +1 -1
 	if (new == pci_channel_io_perm_failure) {
-		dev->error_state == pci_channel_io_perm_failure;
+		dev->error_state = pci_channel_io_perm_failure;

[...]

Ouch! Nice catch.

Heh, the 0-day build actually caught this one, so credit to the bot! :)