Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1657213
| From | David Carrillo-Cisneros <davidcc@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 06/13] perf header: add struct feat_fd for write |
| Date | 2017-06-05 04:00 +0200 |
| Message-ID | <tOPtf-4zu-3@gated-at.bofh.it> (permalink) |
| References | <tKcTv-a4-3@gated-at.bofh.it> <tKcTx-a4-33@gated-at.bofh.it> <tKW0i-5FH-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, May 25, 2017 at 1:07 AM, Jiri Olsa <jolsa@redhat.com> wrote:
> On Tue, May 23, 2017 at 12:48:46AM -0700, David Carrillo-Cisneros wrote:
>
> SNIP
>
>> @@ -2211,18 +2214,18 @@ static int do_write_feat(int fd, struct perf_header *h, int type,
>> if (!feat_ops[type].write)
>> return -1;
>>
>> - (*p)->offset = lseek(fd, 0, SEEK_CUR);
>> + (*p)->offset = lseek(fd->fd, 0, SEEK_CUR);
>>
>> - err = feat_ops[type].write(fd, h, evlist);
>> + err = feat_ops[type].write(fd, evlist);
>> if (err < 0) {
>> pr_debug("failed to write feature %s\n", feat_ops[type].name);
>>
>> /* undo anything written */
>> - lseek(fd, (*p)->offset, SEEK_SET);
>> + lseek(fd->fd, (*p)->offset, SEEK_SET);
>>
>> return -1;
>> }
>> - (*p)->size = lseek(fd, 0, SEEK_CUR) - (*p)->offset;
>> + (*p)->size = lseek(fd->fd, 0, SEEK_CUR) - (*p)->offset;
>> (*p)++;
>> }
>> return ret;
>> @@ -2232,12 +2235,18 @@ static int perf_header__adds_write(struct perf_header *header,
>> struct perf_evlist *evlist, int fd)
>> {
>> int nr_sections;
>> + struct feat_fd fdd;
>> struct perf_file_section *feat_sec, *p;
>> int sec_size;
>> u64 sec_start;
>> int feat;
>> int err;
>>
>> + fdd = (struct feat_fd){
>> + .fd = fd,
>> + .ph = header,
>> + };
>
> could you unite the naming for struct feat_fd variables?
>
> it's slightly confusing, especialy when you keep the 'fd'
> name in some cases.. ff? ;-)
>
Thank you for the review :) . I'll do the rename.
> jirka
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v2 06/13] perf header: add struct feat_fd for write Jiri Olsa <jolsa@redhat.com> - 2017-05-25 10:10 +0200 Re: [PATCH v2 06/13] perf header: add struct feat_fd for write David Carrillo-Cisneros <davidcc@google.com> - 2017-06-05 04:00 +0200
csiph-web