diff options
author | David Carrillo-Cisneros <davidcc@google.com> | 2017-07-18 07:25:37 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-07-19 05:14:29 +0300 |
commit | 7c72440506e2108494bab3b68a4118fa61a9dbf4 (patch) | |
tree | 6aeb313fcf98b6225e785b0cfc438888607e62cf /tools/perf/util/util.h | |
parent | 2ff5365d75e164032f64133914046fd6be213d94 (diff) | |
download | linux-7c72440506e2108494bab3b68a4118fa61a9dbf4.tar.xz |
perf util: Add const modifier to buf in "writen" function
Make buf in helper function "writen" constant to simplify the life of
its callers.
This requires to hack a cast of buf prior to passing it to "ion" which
is simpler than the alternative of reworking the "ion" function to
provide a read and a write paths, the latter with constant buf argument.
Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Acked-by: David Ahern <dsahern@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Simon Que <sque@chromium.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170718042549.145161-5-davidcc@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.h')
-rw-r--r-- | tools/perf/util/util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 062dd20437f7..b136c271125f 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -38,7 +38,7 @@ int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi); int copyfile_offset(int fromfd, loff_t from_ofs, int tofd, loff_t to_ofs, u64 size); ssize_t readn(int fd, void *buf, size_t n); -ssize_t writen(int fd, void *buf, size_t n); +ssize_t writen(int fd, const void *buf, size_t n); size_t hex_width(u64 v); int hex2u64(const char *ptr, u64 *val); |