diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-04-06 13:21:17 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-05-16 14:38:51 -0400 |
commit | dd5477ff3ba978892014ea5f988cb1bf04aa505e (patch) | |
tree | 96e3ded117f7824c0c0a5a2e5cff956504d8efad /scripts/recordmcount.h | |
parent | 449a66fd1fa75d36dca917704827c40c8f416bca (diff) |
ftrace/trivial: Clean up recordmcount.c to use Linux style comparisons
The Linux ftrace subsystem style for comparing is:
var == 1
var > 0
and not:
1 == var
0 < var
It is considered that Linux developers are smart enough not to do the
if (var = 1)
mistake.
Cc: John Reiser <jreiser@bitwagon.com>
Link: http://lkml.kernel.org/r/20110421023737.290712238@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts/recordmcount.h')
-rw-r--r-- | scripts/recordmcount.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index baf187bee983..ac7b3303cb31 100644 --- a/scripts/recordmcount.h +++ b/scripts/recordmcount.h | |||
@@ -275,12 +275,12 @@ static uint_t *sift_rel_mcount(uint_t *mlocp, | |||
275 | Elf_Sym const *const symp = | 275 | Elf_Sym const *const symp = |
276 | &sym0[Elf_r_sym(relp)]; | 276 | &sym0[Elf_r_sym(relp)]; |
277 | char const *symname = &str0[w(symp->st_name)]; | 277 | char const *symname = &str0[w(symp->st_name)]; |
278 | char const *mcount = '_' == gpfx ? "_mcount" : "mcount"; | 278 | char const *mcount = gpfx == '_' ? "_mcount" : "mcount"; |
279 | 279 | ||
280 | if ('.' == symname[0]) | 280 | if (symname[0] == '.') |
281 | ++symname; /* ppc64 hack */ | 281 | ++symname; /* ppc64 hack */ |
282 | if (0 == strcmp(mcount, symname) || | 282 | if (strcmp(mcount, symname) == 0 || |
283 | (altmcount && 0 == strcmp(altmcount, symname))) | 283 | (altmcount && strcmp(altmcount, symname) == 0)) |
284 | mcountsym = Elf_r_sym(relp); | 284 | mcountsym = Elf_r_sym(relp); |
285 | } | 285 | } |
286 | 286 | ||
@@ -290,7 +290,7 @@ static uint_t *sift_rel_mcount(uint_t *mlocp, | |||
290 | mrelp->r_offset = _w(offbase | 290 | mrelp->r_offset = _w(offbase |
291 | + ((void *)mlocp - (void *)mloc0)); | 291 | + ((void *)mlocp - (void *)mloc0)); |
292 | Elf_r_info(mrelp, recsym, reltype); | 292 | Elf_r_info(mrelp, recsym, reltype); |
293 | if (sizeof(Elf_Rela) == rel_entsize) { | 293 | if (rel_entsize == sizeof(Elf_Rela)) { |
294 | ((Elf_Rela *)mrelp)->r_addend = addend; | 294 | ((Elf_Rela *)mrelp)->r_addend = addend; |
295 | *mlocp++ = 0; | 295 | *mlocp++ = 0; |
296 | } else | 296 | } else |
@@ -354,12 +354,12 @@ __has_rel_mcount(Elf_Shdr const *const relhdr, /* is SHT_REL or SHT_RELA */ | |||
354 | Elf_Shdr const *const txthdr = &shdr0[w(relhdr->sh_info)]; | 354 | Elf_Shdr const *const txthdr = &shdr0[w(relhdr->sh_info)]; |
355 | char const *const txtname = &shstrtab[w(txthdr->sh_name)]; | 355 | char const *const txtname = &shstrtab[w(txthdr->sh_name)]; |
356 | 356 | ||
357 | if (0 == strcmp("__mcount_loc", txtname)) { | 357 | if (strcmp("__mcount_loc", txtname) == 0) { |
358 | fprintf(stderr, "warning: __mcount_loc already exists: %s\n", | 358 | fprintf(stderr, "warning: __mcount_loc already exists: %s\n", |
359 | fname); | 359 | fname); |
360 | succeed_file(); | 360 | succeed_file(); |
361 | } | 361 | } |
362 | if (SHT_PROGBITS != w(txthdr->sh_type) || | 362 | if (w(txthdr->sh_type) != SHT_PROGBITS || |
363 | !is_mcounted_section_name(txtname)) | 363 | !is_mcounted_section_name(txtname)) |
364 | return NULL; | 364 | return NULL; |
365 | return txtname; | 365 | return txtname; |
@@ -370,7 +370,7 @@ static char const *has_rel_mcount(Elf_Shdr const *const relhdr, | |||
370 | char const *const shstrtab, | 370 | char const *const shstrtab, |
371 | char const *const fname) | 371 | char const *const fname) |
372 | { | 372 | { |
373 | if (SHT_REL != w(relhdr->sh_type) && SHT_RELA != w(relhdr->sh_type)) | 373 | if (w(relhdr->sh_type) != SHT_REL && w(relhdr->sh_type) != SHT_RELA) |
374 | return NULL; | 374 | return NULL; |
375 | return __has_rel_mcount(relhdr, shdr0, shstrtab, fname); | 375 | return __has_rel_mcount(relhdr, shdr0, shstrtab, fname); |
376 | } | 376 | } |