linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ajay Singh <ajay.kathat@microchip.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <linux-wireless@vger.kernel.org>, <devel@driverdev.osuosl.org>,
	<venkateswara.kaja@microchip.com>, <gregkh@linuxfoundation.org>,
	<ganesh.krishna@microchip.com>, <adham.abozaeid@microchip.com>,
	<aditya.shankar@microchip.com>
Subject: Re: [PATCH 1/4] staging: wilc1000: remove use of 'happened' variable in wilc_spi_read_int()
Date: Thu, 22 Feb 2018 14:09:01 +0530	[thread overview]
Message-ID: <20180222140901.1a2b6ca8@ajaysk-VirtualBox> (raw)
In-Reply-To: <20180222072058.g6wyrsmg5lr6vnef@mwanda>

Hi Dan,

On Thu, 22 Feb 2018 10:20:58 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> On Wed, Feb 21, 2018 at 09:42:09PM +0530, Ajay Singh wrote:
> > Modified wilc_spi_read_int() by removing unnecessary use of "happened"
> > variable.
> > 
> > Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> > ---
> >  drivers/staging/wilc1000/wilc_spi.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
> > index 6b392c9..131d2b7 100644
> > --- a/drivers/staging/wilc1000/wilc_spi.c
> > +++ b/drivers/staging/wilc1000/wilc_spi.c
> > @@ -936,7 +936,7 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
> >  	int ret;
> >  	u32 tmp;
> >  	u32 byte_cnt;
> > -	int happened, j;
> > +	int j;
> >  	u32 unknown_mask;
> >  	u32 irq_flags;
> >  	int k = IRG_FLAGS_OFFSET + 5;
> > @@ -956,8 +956,6 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
> >  
> >  	j = 0;
> >  	do {
> > -		happened = 0;
> > -
> >  		wilc_spi_read_reg(wilc, 0x1a90, &irq_flags);
> >  		tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET);
> >  
> > @@ -972,11 +970,11 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
> >  			dev_err(&spi->dev,
> >  				"Unexpected interrupt(2):j=%d,tmp=%x,mask=%x\n",
> >  				j, tmp, unknown_mask);
> > -				happened = 1;
> > +				break;  
> 
> This is flipped around.  happened means don't break, but you've changed
> it to be the opposite.

You are right. Thanks for pointing it out. It's was a mistake. I will
change 'break' to 'continue' and while(1) to while(0) and resubmit the
patch.


Regards,
Ajay

> 
> regards,
> dan carpenter
> 
> >  		}
> >  
> >  		j++;
> > -	} while (happened);
> > +	} while (1);
> >    
> 

  reply	other threads:[~2018-02-22  8:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 16:12 [PATCH 0/4] staging: wilc1000: modify functions by making use of GENMASK macro Ajay Singh
2018-02-21 16:12 ` [PATCH 1/4] staging: wilc1000: remove use of 'happened' variable in wilc_spi_read_int() Ajay Singh
2018-02-22  7:20   ` Dan Carpenter
2018-02-22  8:39     ` Ajay Singh [this message]
2018-02-22  9:04       ` Dan Carpenter
2018-02-21 16:12 ` [PATCH 2/4] staging: wilc1000: modified wilc_spi_read_int() by using GENMASK macro Ajay Singh
2018-02-22  7:37   ` Dan Carpenter
2018-02-22  9:23     ` Claudiu Beznea
2018-02-22  9:28       ` Claudiu Beznea
2018-02-21 16:12 ` [PATCH 3/4] staging: wilc1000: refactor wilc_spi_clear_int_ext() " Ajay Singh
2018-02-22  7:49   ` Dan Carpenter
2018-02-21 16:12 ` [PATCH 4/4] staging: wilc1000: refactor sdio_clear_int_ext() " Ajay Singh
2018-02-22 14:58 ` [PATCH 0/4] staging: wilc1000: modify functions by making use of " Ajay Singh

Reply instructions:

You may reply publicly 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=20180222140901.1a2b6ca8@ajaysk-VirtualBox \
    --to=ajay.kathat@microchip.com \
    --cc=adham.abozaeid@microchip.com \
    --cc=aditya.shankar@microchip.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=ganesh.krishna@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=venkateswara.kaja@microchip.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).