From: Claudiu Beznea <Claudiu.Beznea@microchip.com>
To: Ajay Singh <ajay.kathat@microchip.com>, <linux-wireless@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <gregkh@linuxfoundation.org>,
<ganesh.krishna@microchip.com>, <venkateswara.kaja@microchip.com>,
<aditya.shankar@microchip.com>
Subject: Re: [PATCH 02/12] staging: wilc1000: fix too many leading tabs warning in sdio_clear_int_ext()
Date: Mon, 19 Feb 2018 15:33:09 +0200 [thread overview]
Message-ID: <7576dfcf-caab-3b2d-c4bb-e1ea29db2fce@microchip.com> (raw)
In-Reply-To: <1518793909-15573-3-git-send-email-ajay.kathat@microchip.com>
Hi Ajay,
On 16.02.2018 17:11, Ajay Singh wrote:
> Refactor sdio_clear_int_ext() function to remove "Too many leading tabs"
> warning reported by checkpatch.pl script.
>
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> ---
> drivers/staging/wilc1000/wilc_sdio.c | 134 +++++++++++++++++------------------
> 1 file changed, 65 insertions(+), 69 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
> index 6ce9c94..27ec90e 100644
> --- a/drivers/staging/wilc1000/wilc_sdio.c
> +++ b/drivers/staging/wilc1000/wilc_sdio.c
> @@ -871,6 +871,7 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val)
> {
> struct sdio_func *func = dev_to_sdio_func(wilc->dev);
> int ret;
> + int vmm_ctl;
>
> if (g_sdio.has_thrpt_enh3) {
> u32 reg;
> @@ -909,84 +910,79 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val)
> goto _fail_;
> }
> }
> - } else {
> - if (g_sdio.irq_gpio) {
> - /* see below. has_thrpt_enh2 uses register 0xf8 to clear interrupts. */
> - /* Cannot clear multiple interrupts. Must clear each interrupt individually */
> - u32 flags;
> -
> - flags = val & (BIT(MAX_NUM_INT) - 1);
> - if (flags) {
> - int i;
> -
> - ret = 1;
> - for (i = 0; i < g_sdio.nint; i++) {
> - if (flags & 1) {
> - struct sdio_cmd52 cmd;
> -
> - cmd.read_write = 1;
> - cmd.function = 0;
> - cmd.raw = 0;
> - cmd.address = 0xf8;
> - cmd.data = BIT(i);
> -
> - ret = wilc_sdio_cmd52(wilc, &cmd);
> - if (ret) {
> - dev_err(&func->dev,
> - "Failed cmd52, set 0xf8 data (%d) ...\n",
> - __LINE__);
> - goto _fail_;
> - }
> + return 1;
> + }> + if (g_sdio.irq_gpio) {
Since you re-factor this, as I suggested in patch:
"[PATCH 6/6] staging: wilc1000: fix line over 80 chars in
wilc_spi_clear_int_ext()" form your previous series:
"fix line over 80 char & coding style in wilc_spi.c",
for code starting here:
> + /* see below. has_thrpt_enh2 uses register 0xf8 to clear interrupts. */
> + /* Cannot clear multiple interrupts. Must clear each interrupt individually */
> + u32 flags;
> +
> + flags = val & (BIT(MAX_NUM_INT) - 1);
> + if (flags) {
> + int i;
> +
> + ret = 1;
> + for (i = 0; i < g_sdio.nint; i++) {
> + if (flags & 1) {
> + struct sdio_cmd52 cmd;
> +
> + cmd.read_write = 1;
> + cmd.function = 0;
> + cmd.raw = 0;
> + cmd.address = 0xf8;
> + cmd.data = BIT(i);
> +
> + ret = wilc_sdio_cmd52(wilc, &cmd);
> + if (ret) {
> + dev_err(&func->dev,
> + "Failed cmd52, set 0xf8 data (%d) ...\n",
> + __LINE__);
> + goto _fail_;
> }
> - if (!ret)
> - break;
> - flags >>= 1;
> }
> if (!ret)
> - goto _fail_;
> - for (i = g_sdio.nint; i < MAX_NUM_INT; i++) {
> - if (flags & 1)
> - dev_err(&func->dev,
> - "Unexpected interrupt cleared %d...\n",
> - i);
> - flags >>= 1;
> - }
> + break;
> + flags >>= 1;
> }
and ending here, further improvements could be done. Since the current series
was accepted, maybe add these to a todo list and review them later?
> - }
> -
> - {
> - u32 vmm_ctl;
> -
> - vmm_ctl = 0;
> - /* select VMM table 0 */
> - if ((val & SEL_VMM_TBL0) == SEL_VMM_TBL0)
> - vmm_ctl |= BIT(0);
> - /* select VMM table 1 */
> - if ((val & SEL_VMM_TBL1) == SEL_VMM_TBL1)
> - vmm_ctl |= BIT(1);
> - /* enable VMM */
> - if ((val & EN_VMM) == EN_VMM)
> - vmm_ctl |= BIT(2);
> -
> - if (vmm_ctl) {
> - struct sdio_cmd52 cmd;
> -
> - cmd.read_write = 1;
> - cmd.function = 0;
> - cmd.raw = 0;
> - cmd.address = 0xf6;
> - cmd.data = vmm_ctl;
> - ret = wilc_sdio_cmd52(wilc, &cmd);
> - if (ret) {
> + if (!ret)
> + goto _fail_;
> + for (i = g_sdio.nint; i < MAX_NUM_INT; i++) {
> + if (flags & 1)
> dev_err(&func->dev,
> - "Failed cmd52, set 0xf6 data (%d) ...\n",
> - __LINE__);
> - goto _fail_;
> - }
> + "Unexpected interrupt cleared %d...\n",
> + i);
> + flags >>= 1;
> }
> }
> }
>
> + vmm_ctl = 0;
> + /* select VMM table 0 */
> + if ((val & SEL_VMM_TBL0) == SEL_VMM_TBL0)
> + vmm_ctl |= BIT(0);
> + /* select VMM table 1 */
> + if ((val & SEL_VMM_TBL1) == SEL_VMM_TBL1)
> + vmm_ctl |= BIT(1);
> + /* enable VMM */
> + if ((val & EN_VMM) == EN_VMM)
> + vmm_ctl |= BIT(2);
> +
> + if (vmm_ctl) {
> + struct sdio_cmd52 cmd;
> +
> + cmd.read_write = 1;
> + cmd.function = 0;
> + cmd.raw = 0;
> + cmd.address = 0xf6;
> + cmd.data = vmm_ctl;
> + ret = wilc_sdio_cmd52(wilc, &cmd);
> + if (ret) {
> + dev_err(&func->dev,
> + "Failed cmd52, set 0xf6 data (%d) ...\n",
> + __LINE__);
> + goto _fail_;
> + }
> + }
> return 1;
> _fail_:
> return 0;
>
next prev parent reply other threads:[~2018-02-19 13:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-16 15:11 [PATCH 00/12] fix to remove line over 80 chars and few other Ajay Singh
2018-02-16 15:11 ` [PATCH 01/12] staging: wilc1000: remove unnecessary comments to avoid line over 80 char issue Ajay Singh
2018-02-16 15:11 ` [PATCH 02/12] staging: wilc1000: fix too many leading tabs warning in sdio_clear_int_ext() Ajay Singh
2018-02-19 13:33 ` Claudiu Beznea [this message]
2018-02-21 16:25 ` Ajay Singh
2018-02-21 16:33 ` Claudiu Beznea
2018-02-16 15:11 ` [PATCH 03/12] staging: wilc1000: fix line over 80 characters " Ajay Singh
2018-02-16 15:11 ` [PATCH 04/12] staging: wilc1000: fix open parenthesis alignment mismatch in wilc_parse_network_info() Ajay Singh
2018-02-19 8:56 ` Dan Carpenter
2018-02-16 15:11 ` [PATCH 05/12] staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set_str() Ajay Singh
2018-02-16 15:11 ` [PATCH 06/12] staging: wilc1000: remove blank line before close brace in wilc_wlan_cfg_get_wid_value() Ajay Singh
2018-02-16 15:11 ` [PATCH 07/12] staging: wilc1000: fix line over 80 chars in wilc_wlan_cfg_indicate_rxi() Ajay Singh
2018-02-16 15:11 ` [PATCH 08/12] staging: wilc1000: fix line over 80 chars in wilc_wlan_cfg_get_wid_value() Ajay Singh
2018-02-16 15:11 ` [PATCH 09/12] staging: wilc1000: fix line over 80 chars in add_tcp_pending_ack() Ajay Singh
2018-02-16 15:11 ` [PATCH 10/12] staging: wilc1000: fix line over 80 characters in tcp_process() Ajay Singh
2018-02-16 15:11 ` [PATCH 11/12] staging: wilc1000: fix line over 80 chars in wilc_wlan_txq_filter_dup_tcp_ack() Ajay Singh
2018-02-19 13:41 ` Claudiu Beznea
2018-02-16 15:11 ` [PATCH 12/12] staging: wilc1000: fix line over 80 chars in wilc_wlan_handle_txq() Ajay Singh
2018-02-16 16:30 ` [PATCH 00/12] fix to remove line over 80 chars and few other Greg KH
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=7576dfcf-caab-3b2d-c4bb-e1ea29db2fce@microchip.com \
--to=claudiu.beznea@microchip.com \
--cc=aditya.shankar@microchip.com \
--cc=ajay.kathat@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).