Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1657183
| From | David Carrillo-Cisneros <davidcc@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 01/13] perf header: encapsulate read and swap |
| Date | 2017-06-05 01:20 +0200 |
| Message-ID | <tOMYp-3c6-1@gated-at.bofh.it> (permalink) |
| References | <tKcTv-a4-3@gated-at.bofh.it> <tKcTx-a4-45@gated-at.bofh.it> <tKGyd-46k-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, May 24, 2017 at 8:35 AM, Namhyung Kim <namhyung@kernel.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@google.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.
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH v2 01/13] perf header: encapsulate read and swap David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 01:20 +0200
csiph-web