From: Yong Zhang <zhang.yong25@zte.com.cn>
To: thomas@monjalon.net, dev@dpdk.org
Cc: zhang.yong25@zte.com.cn, wang.yong19@zte.com.cn,
li.min10@zte.com.cn, ran.ming@zte.com.cn
Subject: raw/gdtc: use standard macros to optimize code style
Date: Tue, 10 Dec 2024 10:11:30 +0800 [thread overview]
Message-ID: <20241210021219.773622-1-zhang.yong25@zte.com.cn> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 2877 bytes --]
Use RTE_BIT to optimize non-standard macro definitions
Signed-off-by: Yong Zhang <zhang.yong25@zte.com.cn>
---
drivers/raw/gdtc/gdtc_rawdev.c | 16 ++++++++--------
drivers/raw/gdtc/gdtc_rawdev.h | 6 +++---
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/raw/gdtc/gdtc_rawdev.c b/drivers/raw/gdtc/gdtc_rawdev.c
index ac6aee3fb3..ee83a67bad 100644
--- a/drivers/raw/gdtc/gdtc_rawdev.c
+++ b/drivers/raw/gdtc/gdtc_rawdev.c
@@ -70,19 +70,19 @@
#define ZXDH_GDMA_BURST_SIZE_MEDIUM 0x4 /* 4 word */
#define ZXDH_GDMA_BURST_SIZE_MAX 0x6 /* 16 word */
#define ZXDH_GDMA_DEFAULT_BURST_LEN 0xf /* 16 beats */
-#define ZXDH_GDMA_TC_CNT_ENABLE (1 << 27)
-#define ZXDH_GDMA_CHAN_FORCE_CLOSE (1 << 31)
+#define ZXDH_GDMA_TC_CNT_ENABLE RTE_BIT32(27)
+#define ZXDH_GDMA_CHAN_FORCE_CLOSE RTE_BIT32(31)
/* TC count & Error interrupt status register */
-#define ZXDH_GDMA_SRC_LLI_ERR (1 << 16)
-#define ZXDH_GDMA_SRC_DATA_ERR (1 << 17)
-#define ZXDH_GDMA_DST_ADDR_ERR (1 << 18)
-#define ZXDH_GDMA_ERR_STATUS (1 << 19)
-#define ZXDH_GDMA_ERR_INTR_ENABLE (1 << 20)
+#define ZXDH_GDMA_SRC_LLI_ERR RTE_BIT32(16)
+#define ZXDH_GDMA_SRC_DATA_ERR RTE_BIT32(17)
+#define ZXDH_GDMA_DST_ADDR_ERR RTE_BIT32(18)
+#define ZXDH_GDMA_ERR_STATUS RTE_BIT32(19)
+#define ZXDH_GDMA_ERR_INTR_ENABLE RTE_BIT32(20)
#define ZXDH_GDMA_TC_CNT_CLEAN (1)
#define ZXDH_GDMA_CHAN_SHIFT 0x80
-#define ZXDH_GDMA_LINK_END_NODE (1 << 30)
+#define ZXDH_GDMA_LINK_END_NODE RTE_BIT32(30)
#define ZXDH_GDMA_CHAN_CONTINUE (1)
#define LOW32_MASK 0xffffffff
diff --git a/drivers/raw/gdtc/gdtc_rawdev.h b/drivers/raw/gdtc/gdtc_rawdev.h
index bc6b0a8e28..1baa9696eb 100644
--- a/drivers/raw/gdtc/gdtc_rawdev.h
+++ b/drivers/raw/gdtc/gdtc_rawdev.h
@@ -28,13 +28,13 @@ extern int zxdh_gdma_rawdev_logtype;
#define ZXDH_GDMA_JOB_SRC_PHY (1UL)
/* States if the destination addresses is physical. */
-#define ZXDH_GDMA_JOB_DEST_PHY (1UL << 1)
+#define ZXDH_GDMA_JOB_DEST_PHY RTE_BIT32(1)
/* ZF->HOST */
-#define ZXDH_GDMA_JOB_DIR_TX (1UL << 2)
+#define ZXDH_GDMA_JOB_DIR_TX RTE_BIT32(2)
/* HOST->ZF */
-#define ZXDH_GDMA_JOB_DIR_RX (1UL << 3)
+#define ZXDH_GDMA_JOB_DIR_RX RTE_BIT32(3)
#define ZXDH_GDMA_JOB_DIR_MASK (ZXDH_GDMA_JOB_DIR_TX | ZXDH_GDMA_JOB_DIR_RX)
--
2.43.0
[-- Attachment #1.1.2: Type: text/html , Size: 6910 bytes --]
next reply other threads:[~2024-12-10 2:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 2:11 Yong Zhang [this message]
2024-12-10 20:37 ` Stephen Hemminger
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=20241210021219.773622-1-zhang.yong25@zte.com.cn \
--to=zhang.yong25@zte.com.cn \
--cc=dev@dpdk.org \
--cc=li.min10@zte.com.cn \
--cc=ran.ming@zte.com.cn \
--cc=thomas@monjalon.net \
--cc=wang.yong19@zte.com.cn \
/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).