[dpdk-dev,5/6] eal: remove useless memset

Message ID 1423925950-5201-5-git-send-email-shemming@brocade.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Stephen Hemminger Feb. 14, 2015, 2:59 p.m. UTC
The path variable is set via snprintf, and does not need to
memset before that.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Bruce Richardson Feb. 19, 2015, 2:58 p.m. UTC | #1
On Sat, Feb 14, 2015 at 09:59:09AM -0500, Stephen Hemminger wrote:
> The path variable is set via snprintf, and does not need to
> memset before that.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

> ---
>  lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> index 590cb56..8d29e06 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> @@ -84,8 +84,6 @@ get_num_hugepages(const char *subdir)
>  	else
>  		nr_hp_file = "free_hugepages";
>  
> -	memset(path, 0, sizeof(path));
> -
>  	snprintf(path, sizeof(path), "%s/%s/%s",
>  			sys_dir_path, subdir, nr_hp_file);
>  
> -- 
> 2.1.4
>
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
index 590cb56..8d29e06 100644
--- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
+++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
@@ -84,8 +84,6 @@  get_num_hugepages(const char *subdir)
 	else
 		nr_hp_file = "free_hugepages";
 
-	memset(path, 0, sizeof(path));
-
 	snprintf(path, sizeof(path), "%s/%s/%s",
 			sys_dir_path, subdir, nr_hp_file);