[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALcN6mjHKxhNGhS1aefc7o27cYaoV5BFDGpsMD-3Amhb13XR3w@mail.gmail.com>
Date: Sun, 4 Jun 2017 16:09:46 -0700
From: David Carrillo-Cisneros <davidcc@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>, Simon Que <sque@...omium.org>,
Wang Nan <wangnan0@...wei.com>, Jiri Olsa <jolsa@...nel.org>,
He Kuang <hekuang@...wei.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
David Ahern <dsa@...ulusnetworks.com>,
Stephane Eranian <eranian@...gle.com>,
Paul Turner <pjt@...gle.com>, kernel-team@....com
Subject: Re: [PATCH v2 01/13] perf header: encapsulate read and swap
On Wed, May 24, 2017 at 8:35 AM, Namhyung Kim <namhyung@...nel.org> wrote:
> On Tue, May 23, 2017 at 12:48:41AM -0700, David Carrillo-Cisneros wrote:
>> Most callers of readn in perf header read either a 32 or a 64 bits
>> number, error check it and swap it, if necessary.
>>
>> Create do_read_u32 and do_read_u64 to simplify this usage.
>>
>> Signed-off-by: David Carrillo-Cisneros <davidcc@...gle.com>
>> ---
>> tools/perf/util/header.c | 212 +++++++++++++++++------------------------------
>> 1 file changed, 76 insertions(+), 136 deletions(-)
>>
>> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
>> index 948b2c5efb65..1dd4dbe13f88 100644
>> --- a/tools/perf/util/header.c
>> +++ b/tools/perf/util/header.c
>> @@ -117,27 +117,56 @@ static int do_write_string(int fd, const char *str)
>> return write_padded(fd, str, olen, len);
>> }
>>
>> +static int __do_read(int fd, void *addr, ssize_t size)
>> +{
>> + ssize_t ret = readn(fd, addr, size);
>> +
>> + if (ret != (ssize_t)size)
>
> The 'size' is already ssize_t.
Will fix.
Powered by blists - more mailing lists