diff mbox series

PCI/ERR: Fix state assignment

Message ID 20210210151604.2678236-1-kbusch@kernel.org (mailing list archive)
State Accepted
Delegated to: Bjorn Helgaas
Headers show
Series PCI/ERR: Fix state assignment | expand

Commit Message

Keith Busch Feb. 10, 2021, 3:16 p.m. UTC
The state was intended to be assigned rather than compared for equality.

Link: https://lore.kernel.org/linux-pci/202102101255.HZtDITwe-lkp@intel.com/
Fixes: 8fae7d8809b815148 ("PCI/ERR: Simplify pci_dev_set_io_state()")
Cc: Bjorn Helgass <helgaas@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/pci/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Wilczyński Feb. 10, 2021, 4:14 p.m. UTC | #1
Hi Keith,

[...]
>  	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.

Reviewed-by: Krzysztof Wilczyński <kw@linux.com>

Krzysztof
Keith Busch Feb. 10, 2021, 4:59 p.m. UTC | #2
On Wed, Feb 10, 2021 at 05:14:26PM +0100, Krzysztof Wilczyński wrote:
> Hi Keith,
> 
> [...]
> >  	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! :)
diff mbox series

Patch

diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index db267120c962..1e4e4cb48bab 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -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;
 	}