diff options
| author | Alejandro Colomar <colomar.6.4.3@gmail.com> | 2020-09-03 21:29:02 +0200 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-09-05 14:49:42 +0200 |
| commit | 3376a638383c1290c6169de294176927b200d89a (patch) | |
| tree | 49cd397a46831fc86142fc7d6a967c7e901d3628 | |
| parent | aff660d379c2462a7875392d96b45abbc46d74c6 (diff) | |
| download | man-pages-3376a638383c1290c6169de294176927b200d89a.tar.gz | |
perf_event_open.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following
way:
- Use the name of the variable instead of its type as argument for
``sizeof``.
Rationale:
https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
| -rw-r--r-- | man2/perf_event_open.2 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2 index 2492fc75a8..ea5ee725fb 100644 --- a/man2/perf_event_open.2 +++ b/man2/perf_event_open.2 @@ -3419,9 +3419,9 @@ main(int argc, char **argv) long long count; int fd; - memset(&pe, 0, sizeof(struct perf_event_attr)); + memset(&pe, 0, sizeof(pe)); pe.type = PERF_TYPE_HARDWARE; - pe.size = sizeof(struct perf_event_attr); + pe.size = sizeof(pe); pe.config = PERF_COUNT_HW_INSTRUCTIONS; pe.disabled = 1; pe.exclude_kernel = 1; |
