[3/4] app/procinfo: remove suspicious sizeof

Message ID 20201117171435.2303641-4-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series cppcheck |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit Nov. 17, 2020, 5:14 p.m. UTC
  The intention with the "sizeof(0)" usage is not clear, but the 'stats'
already 'memset' by 'rte_cryptodev_stats_get()' API, removing 'memset'
in application.

Fixes: fe773600fe3e ("app/procinfo: add --show-crypto")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: vipin.varghese@intel.com
---
 app/proc-info/main.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Varghese, Vipin Nov. 17, 2020, 6:07 p.m. UTC | #1
Thanks Ferruh

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Tuesday, November 17, 2020 10:45 PM
> To: Tahhan, Maryam <maryam.tahhan@intel.com>; Pattan, Reshma
> <reshma.pattan@intel.com>; Mcnamara, John <john.mcnamara@intel.com>;
> Varghese, Vipin <vipin.varghese@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH 3/4] app/procinfo: remove suspicious sizeof
> 
> The intention with the "sizeof(0)" usage is not clear, but the 'stats'
> already 'memset' by 'rte_cryptodev_stats_get()' API, removing 'memset'
> in application.
> 
> Fixes: fe773600fe3e ("app/procinfo: add --show-crypto")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: vipin.varghese@intel.com
> ---
>  app/proc-info/main.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/app/proc-info/main.c b/app/proc-info/main.c index
> c11fe25af4..dc5cc92209 100644
> --- a/app/proc-info/main.c
> +++ b/app/proc-info/main.c
> @@ -1207,7 +1207,6 @@ show_crypto(void)
> 
>  		display_crypto_feature_info(dev_info.feature_flags);
> 
> -		memset(&stats, 0, sizeof(0));
>  		if (rte_cryptodev_stats_get(i, &stats) == 0) {
>  			printf("\t  -- stats\n");
>  			printf("\t\t  + enqueue count (%"PRIu64")"
> --
> 2.26.2
  

Patch

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index c11fe25af4..dc5cc92209 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -1207,7 +1207,6 @@  show_crypto(void)
 
 		display_crypto_feature_info(dev_info.feature_flags);
 
-		memset(&stats, 0, sizeof(0));
 		if (rte_cryptodev_stats_get(i, &stats) == 0) {
 			printf("\t  -- stats\n");
 			printf("\t\t  + enqueue count (%"PRIu64")"