From: Eugene Syromyatnikov Date: Mon, 5 Mar 2018 09:17:44 +0000 (+0100) Subject: bpf: remove page size caching X-Git-Tag: v4.22~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ffdd1dfb6dd6f5f98c74693793dead84755de3c;p=strace bpf: remove page size caching get_pagesize() has a static cache anyway, no need to duplicate it. * bpf.c (SYS_FUNC(bpf)): Remove static size_t page_size and its initialisation, use get_pagesize() as the size of buf directly. --- diff --git a/bpf.c b/bpf.c index 0e07444a..e363a71f 100644 --- a/bpf.c +++ b/bpf.c @@ -409,13 +409,10 @@ SYS_FUNC(bpf) int rc; if (entering(tcp)) { - static size_t page_size; static char *buf; - if (!buf) { - page_size = get_pagesize(); - buf = xmalloc(page_size); - } + if (!buf) + buf = xmalloc(get_pagesize()); printxval(bpf_commands, cmd, "BPF_???"); tprints(", ");