lkml.org 
[lkml]   [2017]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/4] perf tools: Create for_each_event macro for tracepoints iteration
Em Tue, Jan 31, 2017 at 09:21:16AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Jan 31, 2017 at 08:38:28PM +0900, Taeung Song escreveu:
> > - while ((dent = readdir(dir))) {
> > - if (dent->d_type != DT_DIR ||
> > - strcmp(dent->d_name, ".") == 0 ||
> > - strcmp(dent->d_name, "..") == 0 ||
> > - strcmp(dent->d_name, "ftrace") == 0 ||
> > + for_each_event(dir, dent, tps) {
> > + if (!strcmp(dent->d_name, "ftrace") ||
> > !system_in_tp_list(dent->d_name, tps))
> > continue;

> the existing style was == 0, you switched it to !, equivalent, but
> gratuitous, keeping the existing style would make reviewing slightly
> faster, as the pattern wouldn't have changed.

Here it is:

- while ((dent = readdir(dir))) {
- if (dent->d_type != DT_DIR ||
- strcmp(dent->d_name, ".") == 0 ||
- strcmp(dent->d_name, "..") == 0 ||
- strcmp(dent->d_name, "ftrace") == 0 ||
+ for_each_event(dir, dent, tps) {
+ if (strcmp(dent->d_name, "ftrace") == 0 ||
!system_in_tp_list(dent->d_name, tps))
continue;

\
 
 \ /
  Last update: 2017-01-31 13:25    [W:0.073 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site