aboutsummaryrefslogtreecommitdiffstats
path: root/man2
diff options
context:
space:
mode:
authorAlejandro Colomar <colomar.6.4.3@gmail.com>2020-09-03 21:29:02 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-09-05 14:49:42 +0200
commit3376a638383c1290c6169de294176927b200d89a (patch)
tree49cd397a46831fc86142fc7d6a967c7e901d3628 /man2
parentaff660d379c2462a7875392d96b45abbc46d74c6 (diff)
downloadman-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>
Diffstat (limited to 'man2')
-rw-r--r--man2/perf_event_open.24
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;