All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juhee Kang <claudiajkang@gmail.com>
To: ap420073@gmail.com, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org
Subject: [net-next PATCH] amt: Use BIT macros instead of open codes
Date: Sat, 30 Apr 2022 13:56:22 +0000	[thread overview]
Message-ID: <20220430135622.103683-1-claudiajkang@gmail.com> (raw)

Replace open code related to bit operation with BIT macros, which kernel
provided. This patch provides no functional change.

Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
---
 drivers/net/amt.c | 2 +-
 include/net/amt.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 10455c9b9da0..76c1969a03f5 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -959,7 +959,7 @@ static void amt_req_work(struct work_struct *work)
 	amt_update_gw_status(amt, AMT_STATUS_SENT_REQUEST, true);
 	spin_lock_bh(&amt->lock);
 out:
-	exp = min_t(u32, (1 * (1 << amt->req_cnt)), AMT_MAX_REQ_TIMEOUT);
+	exp = min_t(u32, (1 * BIT(amt->req_cnt)), AMT_MAX_REQ_TIMEOUT);
 	mod_delayed_work(amt_wq, &amt->req_wq, msecs_to_jiffies(exp * 1000));
 	spin_unlock_bh(&amt->lock);
 }
diff --git a/include/net/amt.h b/include/net/amt.h
index 7a4db8b903ee..d2fd76b0a424 100644
--- a/include/net/amt.h
+++ b/include/net/amt.h
@@ -354,7 +354,7 @@ struct amt_dev {
 #define AMT_MAX_GROUP		32
 #define AMT_MAX_SOURCE		128
 #define AMT_HSIZE_SHIFT		8
-#define AMT_HSIZE		(1 << AMT_HSIZE_SHIFT)
+#define AMT_HSIZE		BIT(AMT_HSIZE_SHIFT)
 
 #define AMT_DISCOVERY_TIMEOUT	5000
 #define AMT_INIT_REQ_TIMEOUT	1
-- 
2.25.1


             reply	other threads:[~2022-04-30 13:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30 13:56 Juhee Kang [this message]
2022-05-01  9:50 ` [net-next PATCH] amt: Use BIT macros instead of open codes Taehee Yoo
2022-05-02 10:11 ` Paolo Abeni
2022-05-02 17:19   ` Joe Perches
2022-05-03  9:28     ` Taehee Yoo
2022-05-03 11:33       ` Juhee Kang

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=20220430135622.103683-1-claudiajkang@gmail.com \
    --to=claudiajkang@gmail.com \
    --cc=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.