Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] usb: host: ohci-pxa27x: Fix and & vs | typo
Date: Wed, 14 Aug 2019 10:46:04 -0400 (EDT)
Message-ID: <Pine.LNX.4.44L0.1908141045070.1771-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20190814140414.GU1974@kadam>

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


  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 12:33 Dan Carpenter
2019-08-14 14:04 ` [PATCH] " Dan Carpenter
2019-08-14 14:46   ` Alan Stern [this message]
2019-08-15 12:36   ` Greg Kroah-Hartman
2019-08-17  6:55     ` Dan Carpenter

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44L0.1908141045070.1771-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox