recordmcount presents unnecessary challenges to reviewers: It pretends to wrap access to the ELF file in uread/uwrite/ulseek functions which aren't related the way you might think (i.e. not the way read, write, and lseek are releated to each other).
It uses setjmp/longjmp to handle errors (and success) during processing of the object files. This makes it hard to review what functions are doing, how globals change over time, etc. There are some kernel style nits. This series addresses all of those by removing un-helper functions, unused parameters, and rewriting the error/success handling to better resemble regular kernel C code. -- This series was formerly part of a v3 posted under the subject "Cleanup recordmcount and begin objtool conversion". I am reposting it split into two series: these cleanups of recordmcount and a second series that begins the conversion of the cleaned-up recordmcount into an objtool subcommand called mcount. v4: Addressed feedback on v3 from Steven Rostedt: Moved already_has_mcount into recordmcount.c to avoid unnecessary multiple definitions. Changed return semantics of find_secsym_ndx() to avoid need for missing_sym (and multiple definitions) and to separate the returned symbol info (value, index) from success/failure indication. Fixed up local variable declaration to follow inverted christmas tree style. Matt Helsley (8): recordmcount: Remove redundant strcmp recordmcount: Remove uread() recordmcount: Remove unused fd from uwrite() and ulseek() recordmcount: Rewrite error/success handling recordmcount: Kernel style function signature formatting recordmcount: Kernel style formatting recordmcount: Remove redundant cleanup() calls recordmcount: Clarify what cleanup() does scripts/recordmcount.c | 321 ++++++++++++++++++++--------------------- scripts/recordmcount.h | 150 +++++++++++++------ 2 files changed, 259 insertions(+), 212 deletions(-) -- 2.20.1