usb: host: ohci-pxa27x: Fix and & vs | typo
Subsystems (3)
PATCH 1/1 usb: host: ohci-pxa27x: Fix and & vs | typo
The code is supposed to clear the RH_A_NPS and RH_A_PSM bits, but it's a no-op because of the & vs | typo. This bug predates git and it was only discovered using static analysis so it must not affect too many people in real life.
---
Not tested.
drivers/usb/host/ohci-pxa27x.c +1 -1
@@ -148,7 +148,7 @@ static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *pxa_ohci, int mode) uhcrhda |=RH_A_NPS ;break ;case PMM_GLOBAL_MODE : - uhcrhda &= ~(RH_A_NPS &RH_A_PSM ); + uhcrhda &= ~(RH_A_NPS |RH_A_PSM );break ;case PMM_PERPORT_MODE : uhcrhda &= ~(RH_A_NPS );
I was looking at this code again today and I'm still convinced this patch is correct. Should I resend?
regards,
dan carpenter
Quoted 26 lines · Dan Carpenter
The code is supposed to clear the
RH_A_NPSandRH_A_PSMbits, but it's a no-op because of the & vs | typo. This bug predates git and it was only discovered using static analysis so it must not affect too many people in real life.Signed-off-by Dan Carpenter <[email protected]>---
Not tested.drivers/usb/host/ohci-pxa27x.c +1
-2@@ -148,7 +148,7 @@ static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *pxa_ohci, int mode) uhcrhda |=RH_A_NPS ;break ;case PMM_GLOBAL_MODE : - uhcrhda &= ~(RH_A_NPS &RH_A_PSM ); + uhcrhda &= ~(RH_A_NPS |RH_A_PSM );break ;case PMM_PERPORT_MODE : uhcrhda &= ~(RH_A_NPS ); --To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 16 lines · Dan Carpenter
I was looking at this code again today and I'm still convinced this patch is correct. Should I resend?
regards,
dan carpenterQuoted 9 lines · Dan Carpenter
The code is supposed to clear the
RH_A_NPSandRH_A_PSMbits, but it's a no-op because of the & vs | typo. This bug predates git and it was only discovered using static analysis so it must not affect too many people in real life.Signed-off-by Dan Carpenter <[email protected]>---
Not tested.
Quoted 13 lines
drivers/usb/host/ohci-pxa27x.c static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *pxa_ohci, int mode) · line 154
Quoted 13 lines
drivers/usb/host/ohci-pxa27x.c +1
-1@@ -148,7 +148,7 @@ static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *pxa_ohci, int mode) uhcrhda |=RH_A_NPS ;break ;case PMM_GLOBAL_MODE : - uhcrhda &= ~(RH_A_NPS &RH_A_PSM ); + uhcrhda &= ~(RH_A_NPS |RH_A_PSM );break ;case PMM_PERPORT_MODE : uhcrhda &= ~(RH_A_NPS );
The patch sure looks right to me. FWIW:
Alan Stern
Greg Kroah-Hartman
maintainerQuoted 2 lines · Dan Carpenter
I was looking at this code again today and I'm still convinced this patch is correct. Should I resend?
Please resend, it's not in my queue anywhere :(
PATCH 1/1 usb: host: ohci-pxa27x: Fix and & vs | typo
The code is supposed to clear the RH_A_NPS and RH_A_PSM bits, but it's a no-op because of the & vs | typo. This bug predates git and it was only discovered using static analysis so it must not affect too many people in real life.
--- drivers/usb/host/ohci-pxa27x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-pxa27x.c +1 -1
@@ -148,7 +148,7 @@ static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *pxa_ohci, int mode) uhcrhda |=RH_A_NPS ;break ;case PMM_GLOBAL_MODE : - uhcrhda &= ~(RH_A_NPS &RH_A_PSM ); + uhcrhda &= ~(RH_A_NPS |RH_A_PSM );break ;case PMM_PERPORT_MODE : uhcrhda &= ~(RH_A_NPS );
Signature · 1 line
2.20.1