linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* usb: host: ohci-pxa27x: Fix and & vs | typo
@ 2018-02-23 12:33 Dan Carpenter
  2019-08-14 14:04 ` [PATCH] " Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2018-02-23 12:33 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Not tested.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 3e2474959735..7679fb583e41 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -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);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: host: ohci-pxa27x: Fix and & vs | typo
  2018-02-23 12:33 usb: host: ohci-pxa27x: Fix and & vs | typo Dan Carpenter
@ 2019-08-14 14:04 ` Dan Carpenter
  2019-08-14 14:46   ` Alan Stern
  2019-08-15 12:36   ` Greg Kroah-Hartman
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2019-08-14 14:04 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors

I was looking at this code again today and I'm still convinced this
patch is correct.  Should I resend?

regards,
dan carpenter

On Fri, Feb 23, 2018 at 03:33:00PM +0300, Dan Carpenter wrote:
> 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.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Not tested.
> 
> diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
> index 3e2474959735..7679fb583e41 100644
> --- a/drivers/usb/host/ohci-pxa27x.c
> +++ b/drivers/usb/host/ohci-pxa27x.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: host: ohci-pxa27x: Fix and & vs | typo
  2019-08-14 14:04 ` [PATCH] " Dan Carpenter
@ 2019-08-14 14:46   ` Alan Stern
  2019-08-15 12:36   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Stern @ 2019-08-14 14:46 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors

On Wed, 14 Aug 2019, Dan Carpenter wrote:

> I was looking at this code again today and I'm still convinced this
> patch is correct.  Should I resend?
> 
> regards,
> dan carpenter
> 
> On Fri, Feb 23, 2018 at 03:33:00PM +0300, Dan Carpenter wrote:
> > 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.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > Not tested.
> > 
> > diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
> > index 3e2474959735..7679fb583e41 100644
> > --- a/drivers/usb/host/ohci-pxa27x.c
> > +++ b/drivers/usb/host/ohci-pxa27x.c
> > @@ -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:

Acked-by: Alan Stern <stern@rowland.harvard.edu>

Alan Stern


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: host: ohci-pxa27x: Fix and & vs | typo
  2019-08-14 14:04 ` [PATCH] " Dan Carpenter
  2019-08-14 14:46   ` Alan Stern
@ 2019-08-15 12:36   ` Greg Kroah-Hartman
  2019-08-17  6:55     ` Dan Carpenter
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-08-15 12:36 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Alan Stern, linux-usb, kernel-janitors

On Wed, Aug 14, 2019 at 05:04:14PM +0300, Dan Carpenter wrote:
> 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 :(


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] usb: host: ohci-pxa27x: Fix and & vs | typo
  2019-08-15 12:36   ` Greg Kroah-Hartman
@ 2019-08-17  6:55     ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2019-08-17  6:55 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---
 drivers/usb/host/ohci-pxa27x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 3e2474959735..7679fb583e41 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-08-17  6:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-23 12:33 usb: host: ohci-pxa27x: Fix and & vs | typo Dan Carpenter
2019-08-14 14:04 ` [PATCH] " Dan Carpenter
2019-08-14 14:46   ` Alan Stern
2019-08-15 12:36   ` Greg Kroah-Hartman
2019-08-17  6:55     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).