diff mbox series

[v2] usb: host: xhci-hub: drop redundant PORTSC register read

Message ID 0668fd05-6617-633e-e208-a0060efa05ba@omp.ru
State New
Headers show
Series [v2] usb: host: xhci-hub: drop redundant PORTSC register read | expand

Commit Message

Sergey Shtylyov Feb. 14, 2022, 7 p.m. UTC
In xhci_hub_control(), there are many PORTSC register readbacks in several
branches of the *switch* statement which get duplicated right after that
*switch* by reading back that register once more -- which is done to flush
the posted writes.  Drop that redundant PORTSC readback...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.

Changes in version 2:
- dropped the register readback after the *switch* not inside it, updated
  the patch description/subject accordingly;
- added the reigster name in the patch description/subject.

 drivers/usb/host/xhci-hub.c |    2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

Index: usb/drivers/usb/host/xhci-hub.c
===================================================================
--- usb.orig/drivers/usb/host/xhci-hub.c
+++ usb/drivers/usb/host/xhci-hub.c
@@ -1522,8 +1522,6 @@  int xhci_hub_control(struct usb_hcd *hcd
 		default:
 			goto error;
 		}
-		/* unblock any posted writes */
-		temp = readl(ports[wIndex]->addr);
 		break;
 	case ClearPortFeature:
 		if (!wIndex || wIndex > max_ports)