From: Nandha Kumar Singaram <nandhakumar.singaram@gmail.com>
To: Manish Chopra <manishc@marvell.com>,
GR-Linux-NIC-Dev@marvell.com, Coiby Xu <coiby.xu@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
netdev@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: kumaran.4353@gmail.com
Subject: [PATCH v2 2/2] staging: qlge: Prefer using the BIT macro
Date: Wed, 18 Oct 2023 12:47:01 -0700 [thread overview]
Message-ID: <1bab82b0406a0206f8c85f7cc87e5ea554a9781b.1697657604.git.nandhakumar.singaram@gmail.com> (raw)
In-Reply-To: <cover.1697657604.git.nandhakumar.singaram@gmail.com>
Replace the occurrences of (1<<x) by BIT(x) in the files under qlge driver
to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro"
Signed-off-by: Nandha Kumar Singaram <nandhakumar.singaram@gmail.com>
---
drivers/staging/qlge/qlge_main.c | 8 ++++----
drivers/staging/qlge/qlge_mpi.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index 1ead7793062a..9f67e44123cc 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -2191,7 +2191,7 @@ static int qlge_napi_poll_msix(struct napi_struct *napi, int budget)
/* If this TX completion ring belongs to this vector and
* it's not empty then service it.
*/
- if ((ctx->irq_mask & (1 << trx_ring->cq_id)) &&
+ if ((ctx->irq_mask & BIT(trx_ring->cq_id)) &&
(qlge_read_sh_reg(trx_ring->prod_idx_sh_reg) !=
trx_ring->cnsmr_idx)) {
netif_printk(qdev, intr, KERN_DEBUG, qdev->ndev,
@@ -3222,13 +3222,13 @@ static void qlge_set_irq_mask(struct qlge_adapter *qdev, struct intr_context *ct
/* Add the RSS ring serviced by this vector
* to the mask.
*/
- ctx->irq_mask = (1 << qdev->rx_ring[vect].cq_id);
+ ctx->irq_mask = BIT(qdev->rx_ring[vect].cq_id);
/* Add the TX ring(s) serviced by this vector
* to the mask.
*/
for (j = 0; j < tx_rings_per_vector; j++) {
ctx->irq_mask |=
- (1 << qdev->rx_ring[qdev->rss_ring_count +
+ BIT(qdev->rx_ring[qdev->rss_ring_count +
(vect * tx_rings_per_vector) + j].cq_id);
}
} else {
@@ -3236,7 +3236,7 @@ static void qlge_set_irq_mask(struct qlge_adapter *qdev, struct intr_context *ct
* ID into the mask.
*/
for (j = 0; j < qdev->rx_ring_count; j++)
- ctx->irq_mask |= (1 << qdev->rx_ring[j].cq_id);
+ ctx->irq_mask |= BIT(qdev->rx_ring[j].cq_id);
}
}
diff --git a/drivers/staging/qlge/qlge_mpi.c b/drivers/staging/qlge/qlge_mpi.c
index 96a4de6d2b34..ce0b54603071 100644
--- a/drivers/staging/qlge/qlge_mpi.c
+++ b/drivers/staging/qlge/qlge_mpi.c
@@ -113,7 +113,7 @@ int qlge_own_firmware(struct qlge_adapter *qdev)
* core dump and firmware reset after an error.
*/
temp = qlge_read32(qdev, STS);
- if (!(temp & (1 << (8 + qdev->alt_func))))
+ if (!(temp & BIT((8 + qdev->alt_func))))
return 1;
return 0;
--
2.25.1
next prev parent reply other threads:[~2023-10-18 19:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 19:45 [PATCH v2 0/2] staging: qlge: Replace the occurrences of (1<<x) by BIT(x) Nandha Kumar Singaram
2023-10-18 19:46 ` [PATCH v2 1/2] staging: qlge: Fix coding style in qlge.h Nandha Kumar Singaram
2023-10-19 12:27 ` Simon Horman
2023-10-19 13:47 ` Nandha Kumar Singaram
2023-10-19 15:55 ` Simon Horman
2023-10-18 19:47 ` Nandha Kumar Singaram [this message]
2023-10-19 12:29 ` [PATCH v2 2/2] staging: qlge: Prefer using the BIT macro Simon Horman
2023-10-21 9:54 ` [PATCH v2 0/2] staging: qlge: Replace the occurrences of (1<<x) by BIT(x) Greg Kroah-Hartman
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=1bab82b0406a0206f8c85f7cc87e5ea554a9781b.1697657604.git.nandhakumar.singaram@gmail.com \
--to=nandhakumar.singaram@gmail.com \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=coiby.xu@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kumaran.4353@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=manishc@marvell.com \
--cc=netdev@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
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).