From: Ajay Singh <ajay.kathat@microchip.com>
To: Claudiu Beznea <Claudiu.Beznea@microchip.com>
Cc: <linux-wireless@vger.kernel.org>, <devel@driverdev.osuosl.org>,
<gregkh@linuxfoundation.org>, <ganesh.krishna@microchip.com>,
<venkateswara.kaja@microchip.com>, <aditya.shankar@microchip.com>,
<Adham.Abozaeid@microchip.com>
Subject: Re: [PATCH 5/6] staging: wilc1000: fix line over 80 characters in wilc_spi_read_int()
Date: Mon, 19 Feb 2018 13:34:30 +0530 [thread overview]
Message-ID: <20180219133430.0cbe7246@ajaysk-VirtualBox> (raw)
In-Reply-To: <6e94cbbe-d29a-bb3a-0fb4-2a9d0ca0fefd@microchip.com>
On Fri, 16 Feb 2018 20:15:53 +0200
Claudiu Beznea <Claudiu.Beznea@microchip.com> wrote:
> On 14.02.2018 13:10, Ajay Singh wrote:
> > Refactor wilc_spi_read_int() to fix the line over 80 char issues reported
> > by checkpatch.pl script.
> >
> > Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> > ---
> > drivers/staging/wilc1000/wilc_spi.c | 57 +++++++++++++++++++------------------
> > 1 file changed, 29 insertions(+), 28 deletions(-)
> >
> > diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
> > index fddc0db..7c58beb8 100644
> > --- a/drivers/staging/wilc1000/wilc_spi.c
> > +++ b/drivers/staging/wilc1000/wilc_spi.c
> > @@ -939,45 +939,46 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
> > int happened, j;
> > u32 unknown_mask;
> > u32 irq_flags;
> > + int k = IRG_FLAGS_OFFSET + 5;
> >
> > if (g_spi.has_thrpt_enh) {
> > ret = spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE,
> > int_status);
> > - } else {
> > - ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE,
> > - &byte_cnt);
> > - if (!ret) {
> > - dev_err(&spi->dev,
> > - "Failed read WILC_VMM_TO_HOST_SIZE ...\n");
> > - goto _fail_;
> > - }
> > - tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK;
> > + return ret;
> > + }
> > + ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE, &byte_cnt);
> > + if (!ret) {
> > + dev_err(&spi->dev,
> > + "Failed read WILC_VMM_TO_HOST_SIZE ...\n");
> > + goto _fail_;
> > + }
> > + tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK;
> >
> > - j = 0;
> > - do {
> > - happened = 0;
> > + j = 0;
> > + do {
> > + happened = 0;
> You could remove this happen
> >
Yes, we don't need "happened" variable,it can be removed. As the patch
was only to remove the 80 char checkpatch.pl warning. Will remove the
use of this variable in separate patch.
> > - wilc_spi_read_reg(wilc, 0x1a90, &irq_flags);
> > - tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET);
> > + wilc_spi_read_reg(wilc, 0x1a90, &irq_flags);
> > + tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET);
> >
> > - if (g_spi.nint > 5) {
> > - wilc_spi_read_reg(wilc, 0x1a94,
> > - &irq_flags);
> > - tmp |= (((irq_flags >> 0) & 0x7) << (IRG_FLAGS_OFFSET + 5));
> > - }
> > + if (g_spi.nint > 5) {
> > + wilc_spi_read_reg(wilc, 0x1a94, &irq_flags);
> > + tmp |= (((irq_flags >> 0) & 0x7) << k);
> > + }
> >
> > - unknown_mask = ~((1ul << g_spi.nint) - 1);
> > + unknown_mask = ~((1ul << g_spi.nint) - 1);
> You could use GENMASK(g_spi.nint - 1, 0) instead of ~((1ul << g_spi.nint) - 1)
> >
Will do the modification to make use of GENMASK in future patch.
> > - if ((tmp >> IRG_FLAGS_OFFSET) & unknown_mask) {
> > - dev_err(&spi->dev, "Unexpected interrupt (2): j=%d, tmp=%x, mask=%x\n", j, tmp, unknown_mask);
> > - happened = 1;
> > - }
> > + if ((tmp >> IRG_FLAGS_OFFSET) & unknown_mask) {
> > + dev_err(&spi->dev,
> > + "Unexpected interrupt(2):j=%d,tmp=%x,mask=%x\n",
> > + j, tmp, unknown_mask);
> > + happened = 1;
> And here just break;
> > + }
> >
> > - j++;
> > - } while (happened);
> And here use while (true);
> > + j++;
> > + } while (happened);
> >
> > - *int_status = tmp;
> > - }
> > + *int_status = tmp;
> >
> > _fail_:
> > return ret;
> >
regards,
ajay
next prev parent reply other threads:[~2018-02-19 8:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 11:10 [PATCH 0/6] fix line over 80 char & coding style in wilc_spi.c Ajay Singh
2018-02-14 11:10 ` [PATCH 1/6] staging: wilc1000: modified code comments as per linux coding style Ajay Singh
2018-02-16 18:15 ` Claudiu Beznea
2018-02-14 11:10 ` [PATCH 2/6] staging: wilc1000: removed the unnecessary commented code Ajay Singh
2018-02-14 11:10 ` [PATCH 3/6] staging: wilc1000: fix line over 80 characters in spi_cmd_complete() Ajay Singh
2018-02-16 18:15 ` Claudiu Beznea
2018-02-14 11:10 ` [PATCH 4/6] staging: wilc1000: fix line over 80 characters in wilc_spi_init() Ajay Singh
2018-02-16 14:30 ` Greg KH
2018-02-19 6:37 ` Ajay Singh
2018-02-14 11:10 ` [PATCH 5/6] staging: wilc1000: fix line over 80 characters in wilc_spi_read_int() Ajay Singh
2018-02-16 18:15 ` Claudiu Beznea
2018-02-19 8:04 ` Ajay Singh [this message]
2018-02-14 11:10 ` [PATCH 6/6] staging: wilc1000: fix line over 80 chars in wilc_spi_clear_int_ext() Ajay Singh
2018-02-16 18:16 ` Claudiu Beznea
2018-02-19 7:49 ` 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=20180219133430.0cbe7246@ajaysk-VirtualBox \
--to=ajay.kathat@microchip.com \
--cc=Adham.Abozaeid@microchip.com \
--cc=Claudiu.Beznea@microchip.com \
--cc=aditya.shankar@microchip.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).