diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-02-13 21:25:53 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-02-15 02:31:39 +0300 |
commit | 1ad9cbb890f059dd233868654bb9d9e4430b095c (patch) | |
tree | 2ab84aec12d5ef2766b9565ad86ebdfea5e96afb /tools/lib/bpf/btf.c | |
parent | fb405883c189dd30f2fab2b3e2c954f34f000ac3 (diff) | |
download | linux-1ad9cbb890f059dd233868654bb9d9e4430b095c.tar.xz |
tools/bpf: replace bzero with memset
bzero() call is deprecated and superseded by memset().
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Reported-by: David Laight <david.laight@aculab.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/btf.c')
-rw-r--r-- | tools/lib/bpf/btf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c index 6953fedb88ff..ade1c32fb083 100644 --- a/tools/lib/bpf/btf.c +++ b/tools/lib/bpf/btf.c @@ -4,7 +4,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <strings.h> #include <unistd.h> #include <errno.h> #include <linux/err.h> @@ -484,7 +483,7 @@ int btf__get_from_id(__u32 id, struct btf **btf) goto exit_free; } - bzero(ptr, last_size); + memset(ptr, 0, last_size); btf_info.btf = ptr_to_u64(ptr); err = bpf_obj_get_info_by_fd(btf_fd, &btf_info, &len); @@ -498,7 +497,7 @@ int btf__get_from_id(__u32 id, struct btf **btf) goto exit_free; } ptr = temp_ptr; - bzero(ptr, last_size); + memset(ptr, 0, last_size); btf_info.btf = ptr_to_u64(ptr); err = bpf_obj_get_info_by_fd(btf_fd, &btf_info, &len); } |