From: Oleksandr Kolomeiets <okl-plv@napatech.com>
To: dev@dpdk.org
Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com,
stephen@networkplumber.org, thomas@monjalon.net,
Danylo Vodopianov <dvo-plv@napatech.com>
Subject: [PATCH v1 21/25] net/ntnic: remove unnecessary void cast
Date: Wed, 30 Apr 2025 15:48:33 +0200 [thread overview]
Message-ID: <20250430134840.402553-22-okl-plv@napatech.com> (raw)
In-Reply-To: <20250430134840.402553-1-okl-plv@napatech.com>
From: Danylo Vodopianov <dvo-plv@napatech.com>
There is no need to cast memset to void.
Signed-off-by: Danylo Vodopianov <dvo-plv@napatech.com>
---
drivers/net/ntnic/nim/i2c_nim.c | 2 +-
drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c | 2 +-
drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 4 ++--
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 4 ++--
drivers/net/ntnic/ntnic_ethdev.c | 2 +-
17 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/drivers/net/ntnic/nim/i2c_nim.c b/drivers/net/ntnic/nim/i2c_nim.c
index c6fa75e13a..66729e3ab4 100644
--- a/drivers/net/ntnic/nim/i2c_nim.c
+++ b/drivers/net/ntnic/nim/i2c_nim.c
@@ -304,7 +304,7 @@ static int qsfp_nim_state_build(nim_i2c_ctx_t *ctx, sfp_nim_state_t *state)
RTE_ASSERT(ctx && state);
RTE_ASSERT(ctx->nim_id != NT_NIM_UNKNOWN && "Nim is not initialized");
- (void)memset(state, 0, sizeof(*state));
+ memset(state, 0, sizeof(*state));
switch (ctx->nim_id) {
case 12U:
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c
index 23139b0305..d60dae6912 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c
@@ -18,7 +18,7 @@ struct cat_nthw *cat_nthw_new(void)
struct cat_nthw *p = malloc(sizeof(struct cat_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -26,7 +26,7 @@ struct cat_nthw *cat_nthw_new(void)
void cat_nthw_delete(struct cat_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c
index 945d46415c..4ad169b943 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c
@@ -22,7 +22,7 @@ struct csu_nthw *csu_nthw_new(void)
struct csu_nthw *p = malloc(sizeof(struct csu_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -30,7 +30,7 @@ struct csu_nthw *csu_nthw_new(void)
void csu_nthw_delete(struct csu_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c
index a56d3c5038..372f735c2b 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c
@@ -20,7 +20,7 @@ struct flm_nthw *flm_nthw_new(void)
struct flm_nthw *p = malloc(sizeof(struct flm_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -28,7 +28,7 @@ struct flm_nthw *flm_nthw_new(void)
void flm_nthw_delete(struct flm_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c
index 2559f2ec77..14ad74396f 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c
@@ -22,7 +22,7 @@ struct hfu_nthw *hfu_nthw_new(void)
struct hfu_nthw *p = malloc(sizeof(struct hfu_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -30,7 +30,7 @@ struct hfu_nthw *hfu_nthw_new(void)
void hfu_nthw_delete(struct hfu_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c
index ab9c793e3a..f8cfa94a15 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c
@@ -23,7 +23,7 @@ struct hsh_nthw *hsh_nthw_new(void)
struct hsh_nthw *p = malloc(sizeof(struct hsh_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -31,7 +31,7 @@ struct hsh_nthw *hsh_nthw_new(void)
void hsh_nthw_delete(struct hsh_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c
index 418dd41a53..78835654dc 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c
@@ -22,7 +22,7 @@ struct ifr_nthw *ifr_nthw_new(void)
struct ifr_nthw *p = malloc(sizeof(struct ifr_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c
index 2db4411c9e..f945f33fff 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c
@@ -23,7 +23,7 @@ struct info_nthw *info_nthw_new(void)
struct info_nthw *p = malloc(sizeof(struct info_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -31,7 +31,7 @@ struct info_nthw *info_nthw_new(void)
void info_nthw_delete(struct info_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c
index 57471ef430..10450b3600 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c
@@ -32,7 +32,7 @@ struct km_nthw *km_nthw_new(void)
struct km_nthw *p = malloc(sizeof(struct km_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -40,7 +40,7 @@ struct km_nthw *km_nthw_new(void)
void km_nthw_delete(struct km_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c
index 80dc8c14c4..132ee14baf 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c
@@ -23,7 +23,7 @@ struct pdb_nthw *pdb_nthw_new(void)
struct pdb_nthw *p = malloc(sizeof(struct pdb_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -31,7 +31,7 @@ struct pdb_nthw *pdb_nthw_new(void)
void pdb_nthw_delete(struct pdb_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c
index cf4dc2c8eb..d2c7130f2e 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c
@@ -23,7 +23,7 @@ struct qsl_nthw *qsl_nthw_new(void)
struct qsl_nthw *p = malloc(sizeof(struct qsl_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -31,7 +31,7 @@ struct qsl_nthw *qsl_nthw_new(void)
void qsl_nthw_delete(struct qsl_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c
index 99245bddaf..1bb69e740f 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c
@@ -22,7 +22,7 @@ struct rpp_lr_nthw *rpp_lr_nthw_new(void)
struct rpp_lr_nthw *p = malloc(sizeof(struct rpp_lr_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -30,7 +30,7 @@ struct rpp_lr_nthw *rpp_lr_nthw_new(void)
void rpp_lr_nthw_delete(struct rpp_lr_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c
index 78cee7ebea..f5030d1997 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c
@@ -23,7 +23,7 @@ struct slc_lr_nthw *slc_lr_nthw_new(void)
struct slc_lr_nthw *p = malloc(sizeof(struct slc_lr_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -31,7 +31,7 @@ struct slc_lr_nthw *slc_lr_nthw_new(void)
void slc_lr_nthw_delete(struct slc_lr_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c
index 0ecdeb8893..bb7b9c2946 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c
@@ -22,7 +22,7 @@ struct tx_cpy_nthw *tx_cpy_nthw_new(void)
struct tx_cpy_nthw *p = malloc(sizeof(struct tx_cpy_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -31,7 +31,7 @@ void tx_cpy_nthw_delete(struct tx_cpy_nthw *p)
{
if (p) {
free(p->m_writers);
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c
index 3ac44c6743..2409875a5a 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c
@@ -22,7 +22,7 @@ struct tx_ins_nthw *tx_ins_nthw_new(void)
struct tx_ins_nthw *p = malloc(sizeof(struct tx_ins_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -30,7 +30,7 @@ struct tx_ins_nthw *tx_ins_nthw_new(void)
void tx_ins_nthw_delete(struct tx_ins_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c
index 9dfcaa99c7..b787c38ee2 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c
@@ -22,7 +22,7 @@ struct tx_rpl_nthw *tx_rpl_nthw_new(void)
struct tx_rpl_nthw *p = malloc(sizeof(struct tx_rpl_nthw));
if (p)
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
return p;
}
@@ -30,7 +30,7 @@ struct tx_rpl_nthw *tx_rpl_nthw_new(void)
void tx_rpl_nthw_delete(struct tx_rpl_nthw *p)
{
if (p) {
- (void)memset(p, 0, sizeof(*p));
+ memset(p, 0, sizeof(*p));
free(p);
}
}
diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c
index e46e93e347..d15e1fd13b 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -1256,7 +1256,7 @@ eth_set_mc_addr_list(struct rte_eth_dev *eth_dev,
mc_addrs[i] = mc_addr_set[i];
else
- (void)memset(&mc_addrs[i], 0, sizeof(mc_addrs[i]));
+ memset(&mc_addrs[i], 0, sizeof(mc_addrs[i]));
return 0;
}
--
2.47.1
next prev parent reply other threads:[~2025-04-30 13:52 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 13:48 [PATCH v1 00/25] net/ntnic: fixes and improvements Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 01/25] net/ntnic: remove usage of the variable-length arrays Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 02/25] net/ntnic: handle string truncations when using strlcpy Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 03/25] net/ntnic: replace pragma pack with DPDK defined macros Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 04/25] net/ntnic: remove extra memset Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 05/25] net/ntnic: include all queues into statistics Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 06/25] net/ntnic: avoid misleading variable names Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 07/25] net/ntnic: apply packing to the structure Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 08/25] net/ntnic: improve logging format specifiers Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 09/25] net/ntnic: remove usless expressions Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 10/25] net/ntnic: remove unused code Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 11/25] net/ntnic: remove usless part of conditional expression Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 12/25] net/ntnic: add error logging for hsh Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 13/25] net/ntnic: add explicitly specificator Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 14/25] net/ntnic: add handle memory allocation failures Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 15/25] net/ntnic: remove redundant initialization Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 16/25] net/ntnic: enhance null checks and assertions Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 17/25] net/ntnic: add return value check Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 18/25] net/ntnic: remove redundant assignments and branching Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 19/25] net/ntnic: rework array usage Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 20/25] net/ntnic: avoid divide by zero Oleksandr Kolomeiets
2025-04-30 13:48 ` Oleksandr Kolomeiets [this message]
2025-04-30 13:48 ` [PATCH v1 22/25] net/ntnic: remove unnecessary memset Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 23/25] net/ntnic: add null verification Oleksandr Kolomeiets
2025-04-30 13:48 ` [PATCH v1 24/25] net/ntnic: avoid possible deadlock Oleksandr Kolomeiets
2025-04-30 14:05 ` Stephen Hemminger
2025-04-30 13:48 ` [PATCH v1 25/25] net/ntnic: fix operation with rte ring queue Oleksandr Kolomeiets
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=20250430134840.402553-22-okl-plv@napatech.com \
--to=okl-plv@napatech.com \
--cc=ckm@napatech.com \
--cc=dev@dpdk.org \
--cc=dvo-plv@napatech.com \
--cc=mko-plv@napatech.com \
--cc=sil-plv@napatech.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/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).