diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-02-13 13:25:53 -0500 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-02-14 18:31:39 -0500 |
commit | 1ad9cbb890f059dd233868654bb9d9e4430b095c (patch) | |
tree | 2ab84aec12d5ef2766b9565ad86ebdfea5e96afb /tools/lib/bpf/btf.c | |
parent | fb405883c189dd30f2fab2b3e2c954f34f000ac3 (diff) |
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 @@ | |||
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | #include <stdlib.h> | 5 | #include <stdlib.h> |
6 | #include <string.h> | 6 | #include <string.h> |
7 | #include <strings.h> | ||
8 | #include <unistd.h> | 7 | #include <unistd.h> |
9 | #include <errno.h> | 8 | #include <errno.h> |
10 | #include <linux/err.h> | 9 | #include <linux/err.h> |
@@ -484,7 +483,7 @@ int btf__get_from_id(__u32 id, struct btf **btf) | |||
484 | goto exit_free; | 483 | goto exit_free; |
485 | } | 484 | } |
486 | 485 | ||
487 | bzero(ptr, last_size); | 486 | memset(ptr, 0, last_size); |
488 | btf_info.btf = ptr_to_u64(ptr); | 487 | btf_info.btf = ptr_to_u64(ptr); |
489 | err = bpf_obj_get_info_by_fd(btf_fd, &btf_info, &len); | 488 | err = bpf_obj_get_info_by_fd(btf_fd, &btf_info, &len); |
490 | 489 | ||
@@ -498,7 +497,7 @@ int btf__get_from_id(__u32 id, struct btf **btf) | |||
498 | goto exit_free; | 497 | goto exit_free; |
499 | } | 498 | } |
500 | ptr = temp_ptr; | 499 | ptr = temp_ptr; |
501 | bzero(ptr, last_size); | 500 | memset(ptr, 0, last_size); |
502 | btf_info.btf = ptr_to_u64(ptr); | 501 | btf_info.btf = ptr_to_u64(ptr); |
503 | err = bpf_obj_get_info_by_fd(btf_fd, &btf_info, &len); | 502 | err = bpf_obj_get_info_by_fd(btf_fd, &btf_info, &len); |
504 | } | 503 | } |