USB: ehci_brcm_hub_control: replace wIndex-1 with temp
Subsystems (3)
PATCH 2/2 USB: ehci_brcm_hub_control: replace wIndex-1 with temp
In function ehci_brcm_hub_control, like following code, it filters out the case where the upper byte of wIndex is nonzero, so it need be replaced with temp.
```
if ((typeReq == GetPortStatus) &&
(wIndex && wIndex <= ports) && // need to be replaced
ehci->reset_done[wIndex-1] &&
time_after_eq(jiffies, ehci->reset_done[wIndex-1]) &&
(ehci_readl(ehci, status_reg) & PORT_RESUME)) {
```--- drivers/usb/host/ehci-brcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/host/ehci-brcm.c +3 -3
@@ -73,9 +73,9 @@ static int ehci_brcm_hub_control(* of RESUME */ if ((typeReq == GetPortStatus) && - (wIndex && wIndex <= ports) && - ehci->reset_done[wIndex-1 ] && -time_after_eq (jiffies, ehci->reset_done[wIndex-1 ]) && + (temp < ports) && + ehci->reset_done[temp] && +time_after_eq (jiffies, ehci->reset_done[temp]) && (ehci_readl (ehci, status_reg) &PORT_RESUME )) {/*
Signature · 1 line
2.30.1 (Apple Git-130)
Greg KH
maintainerQuoted 3 lines · Haimin Zhang
In function
ehci_brcm_hub_control, like following code, it filters out the case where the upper byte of wIndex is nonzero, so it need be replaced with temp.
I do not understand this text, can you try to reword it?
And you have trailing whitespace.
And why use `?
Quoted 1 line
```
What is this for? Changelog comments are not in markdown format.
Quoted 2 lines
if ((typeReq == GetPortStatus) && (wIndex && wIndex <= ports) && // need to be replaced
What does this comment mean?
Quoted 7 lines
ehci->reset_done[wIndex-1] && time_after_eq(jiffies, ehci->reset_done[wIndex-1]) && (ehci_readl(ehci, status_reg) & PORT_RESUME)) {```
Signed-off-by Haimin Zhang <[email protected]>Reported-by TCS Robot <[email protected]>
Again, lines need to be in different order, and your from: line is not correct.
Also, you need an individual email address, not a group email alias for your contributions. We work with individuals, not groups.
Quoted 9 lines
--- drivers/usb/host/ehci-brcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/usb/host/ehci-brcm.c +0
-0
drivers/usb/host/ehci-brcm.c static int ehci_brcm_hub_control( · line 76
Quoted 7 lines
drivers/usb/host/ehci-brcm.c +1
-3@@ -73,9 +73,9 @@ static int ehci_brcm_hub_control(* of RESUME */ if ((typeReq == GetPortStatus) && - (wIndex && wIndex <= ports) && - ehci->reset_done[wIndex-1] && - time_after_eq(jiffies, ehci->reset_done[wIndex-1]) && + (temp < ports) &&
Where did temp come from?
thanks,
greg k-h
Alan Stern
maintainerQuoted 40 lines · Greg KH
Quoted 3 lines · Haimin Zhang
In function
ehci_brcm_hub_control, like following code, it filters out the case where the upper byte of wIndex is nonzero, so it need be replaced with temp.I do not understand this text, can you try to reword it?
And you have trailing whitespace.
And why use `?
Quoted 1 line
```
What is this for? Changelog comments are not in markdown format.
Quoted 2 lines
if ((typeReq == GetPortStatus) && (wIndex && wIndex <= ports) && // need to be replacedWhat does this comment mean?
Quoted 7 lines
ehci->reset_done[wIndex-1] && time_after_eq(jiffies, ehci->reset_done[wIndex-1]) && (ehci_readl(ehci, status_reg) & PORT_RESUME)) {```
Signed-off-by Haimin Zhang <[email protected]>Reported-by TCS Robot <[email protected]>Again, lines need to be in different order, and your from: line is not correct.
Also, you need an individual email address, not a group email alias for your contributions. We work with individuals, not groups.
Quoted 4 lines
--- drivers/usb/host/ehci-brcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 14 lines
drivers/usb/host/ehci-brcm.c static int ehci_brcm_hub_control( · line 76
Quoted 12 lines
drivers/usb/host/ehci-brcm.c +1
-3@@ -73,9 +73,9 @@ static int ehci_brcm_hub_control(* of RESUME */ if ((typeReq == GetPortStatus) && - (wIndex && wIndex <= ports) && - ehci->reset_done[wIndex-1] && - time_after_eq(jiffies, ehci->reset_done[wIndex-1]) && + (temp < ports) &&Where did temp come from?
Also, as long as this piece of code is being changed, it would be a good idea to get rid of all the unnecessary parentheses.
Alan Stern
Quoted 25 lines · Greg KH
Quoted 3 lines · Haimin Zhang
In function
ehci_brcm_hub_control, like following code, it filters out the case where the upper byte of wIndex is nonzero, so it need be replaced with temp.I do not understand this text, can you try to reword it?
And you have trailing whitespace.
And why use `?
Quoted 1 line
```
What is this for? Changelog comments are not in markdown format.
Quoted 2 lines
if ((typeReq == GetPortStatus) && (wIndex && wIndex <= ports) && // need to be replacedWhat does this comment mean?
Quoted 5 lines
ehci->reset_done[wIndex-1] && time_after_eq(jiffies, ehci->reset_done[wIndex-1]) && (ehci_readl(ehci, status_reg) & PORT_RESUME)) {```
Quoted 8 lines
Quoted 2 lines
Signed-off-by Haimin Zhang <[email protected]>Reported-by TCS Robot <[email protected]>Again, lines need to be in different order, and your from: line is not correct.
Also, you need an individual email address, not a group email alias for your contributions. We work with individuals, not groups.
Also, would you mind copying the people who are remotely involved with this piece of code, like Al? Thank you
Signature · 1 line
Florian