Commit d6a238d25014d0ff918410d73e2a6300bca5d1f1
Committed by
Greg Kroah-Hartman
1 parent
ae27f86a21
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
dynamic_debug: drop explicit !=NULL checks
Convert 'if (x !=NULL)' checks into 'if (x)'. Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 5 additions and 6 deletions Side-by-side Diff
lib/dynamic_debug.c
... | ... | @@ -115,27 +115,26 @@ |
115 | 115 | list_for_each_entry(dt, &ddebug_tables, link) { |
116 | 116 | |
117 | 117 | /* match against the module name */ |
118 | - if (query->module != NULL && | |
119 | - strcmp(query->module, dt->mod_name)) | |
118 | + if (query->module && strcmp(query->module, dt->mod_name)) | |
120 | 119 | continue; |
121 | 120 | |
122 | 121 | for (i = 0 ; i < dt->num_ddebugs ; i++) { |
123 | 122 | struct _ddebug *dp = &dt->ddebugs[i]; |
124 | 123 | |
125 | 124 | /* match against the source filename */ |
126 | - if (query->filename != NULL && | |
125 | + if (query->filename && | |
127 | 126 | strcmp(query->filename, dp->filename) && |
128 | 127 | strcmp(query->filename, basename(dp->filename))) |
129 | 128 | continue; |
130 | 129 | |
131 | 130 | /* match against the function */ |
132 | - if (query->function != NULL && | |
131 | + if (query->function && | |
133 | 132 | strcmp(query->function, dp->function)) |
134 | 133 | continue; |
135 | 134 | |
136 | 135 | /* match against the format */ |
137 | - if (query->format != NULL && | |
138 | - strstr(dp->format, query->format) == NULL) | |
136 | + if (query->format && | |
137 | + !strstr(dp->format, query->format)) | |
139 | 138 | continue; |
140 | 139 | |
141 | 140 | /* match against the line number range */ |