From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Christian Koue Muf <ckm@napatech.com>,
Serhii Iliushyk <sil-plv@napatech.com>
Subject: [PATCH v3 09/11] net/ntnic: remove unnecessary void cast
Date: Wed, 13 Nov 2024 18:35:58 -0800 [thread overview]
Message-ID: <20241114023738.141821-10-stephen@networkplumber.org> (raw)
In-Reply-To: <20241114023738.141821-1-stephen@networkplumber.org>
There is no need to cast memset to void.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
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 e6f7755ded..f9fec5f767 100644
--- a/drivers/net/ntnic/nim/i2c_nim.c
+++ b/drivers/net/ntnic/nim/i2c_nim.c
@@ -292,7 +292,7 @@ static int qsfp_nim_state_build(nim_i2c_ctx_t *ctx, sfp_nim_state_t *state)
assert(ctx && state);
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 d3213593e1..649a060682 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 c1b73179a8..dc3582c9f5 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 8855978349..7647949bc7 100644
--- a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c
+++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c
@@ -19,7 +19,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;
}
@@ -27,7 +27,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 4a8b17101d..d0e65c071d 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 80ead2729a..caf84790cd 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 11b6b5e5b8..df2bd1cc5c 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 8e0b24dd9a..007c71d1b0 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 edc8f58759..3909194214 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 4a9713965b..700d868cef 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 c887fe25e2..47fea6553f 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 28c7a05fe2..2f141acbde 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 e062a700eb..e278ad0a41 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 ee85a1c61b..58e5672462 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 47af44945f..0ff9af22c7 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 c40857db0f..221ea94eed 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 2a2643a106..9f3e9440dd 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -1251,7 +1251,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.45.2
next prev parent reply other threads:[~2024-11-14 2:38 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 1:10 [PATCH 0/3] introduce rte_memset_sensative Stephen Hemminger
2024-11-14 1:10 ` [PATCH 1/3] eal: " Stephen Hemminger
2024-11-14 1:10 ` [PATCH 2/3] crypto/qat: use rte_memset_sensative Stephen Hemminger
2024-11-14 1:10 ` [PATCH 3/3] eal: add rte_free_sensative Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 0/8] memset security handling Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 1/8] eal: introduce new secure memory fill Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 2/8] eal: add new secure free function Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 3/8] crypto/qat: force zero of keys Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 4/8] crypto/qat: fix size calculation for memset Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 5/8] crypto/qat: use secure memset Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 6/8] bus/uacce: remove memset before free Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 7/8] compress/octeontx: remove unnecessary memset Stephen Hemminger
2024-11-14 1:52 ` [PATCH v2 8/8] test: remove unneeded memset Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 00/11] memset security handling Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 01/11] eal: introduce new secure memory fill Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 02/11] eal: add new secure free function Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 03/11] crypto/qat: force zero of keys Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 04/11] crypto/qat: fix size calculation for memset Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 05/11] crypto/qat: use secure memset Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 06/11] bus/uacce: remove memset before free Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 07/11] compress/octeontx: remove unnecessary memset Stephen Hemminger
2024-11-14 2:35 ` [PATCH v3 08/11] test: remove unneeded memset Stephen Hemminger
2024-11-14 2:35 ` Stephen Hemminger [this message]
2024-11-14 2:35 ` [PATCH v3 10/11] net/ntnic: check result of malloc Stephen Hemminger
2024-11-14 2:36 ` [PATCH v3 11/11] net/ntnic: remove unnecessary memset Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 00/12] memset security fixes Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 01/12] eal: introduce new secure memory fill Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 02/12] eal: add new secure free function Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 03/12] crypto/qat: force zero of keys Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 04/12] crypto/qat: fix size calculation for memset Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 05/12] crypto/qat: use secure memset Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 06/12] bus/uacce: remove memset before free Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 07/12] compress/octeontx: remove unnecessary memset Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 08/12] test: remove unneeded memset Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 09/12] net/ntnic: remove unnecessary void cast Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 10/12] net/ntnic: check result of malloc Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 11/12] net/ntnic: remove unnecessary memset Stephen Hemminger
2024-11-14 18:43 ` [PATCH v4 12/12] devtools/cocci: add script to find problematic memset 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=20241114023738.141821-10-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=ckm@napatech.com \
--cc=dev@dpdk.org \
--cc=sil-plv@napatech.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).