Commit 3aec8638 authored by Matt Helsley's avatar Matt Helsley Committed by Steven Rostedt (VMware)

recordmcount: Kernel style function signature formatting

The uwrite() and ulseek() functions are formatted inconsistently
with the rest of the file and the kernel overall. While we're
making other changes here let's fix this.

Link: http://lkml.kernel.org/r/4c67698f734be9867a2aba7035fe0ce59e1e4423.1564596289.git.mhelsley@vmware.comSigned-off-by: default avatarMatt Helsley <mhelsley@vmware.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 3f1df120
...@@ -52,8 +52,7 @@ static void *file_append; /* added to the end of the file */ ...@@ -52,8 +52,7 @@ static void *file_append; /* added to the end of the file */
static size_t file_append_size; /* how much is added to end of file */ static size_t file_append_size; /* how much is added to end of file */
/* Per-file resource cleanup when multiple files. */ /* Per-file resource cleanup when multiple files. */
static void static void cleanup(void)
cleanup(void)
{ {
if (!mmap_failed) if (!mmap_failed)
munmap(file_map, sb.st_size); munmap(file_map, sb.st_size);
...@@ -68,8 +67,7 @@ cleanup(void) ...@@ -68,8 +67,7 @@ cleanup(void)
/* ulseek, uwrite, ...: Check return value for errors. */ /* ulseek, uwrite, ...: Check return value for errors. */
static off_t static off_t ulseek(off_t const offset, int const whence)
ulseek(off_t const offset, int const whence)
{ {
switch (whence) { switch (whence) {
case SEEK_SET: case SEEK_SET:
...@@ -89,8 +87,7 @@ ulseek(off_t const offset, int const whence) ...@@ -89,8 +87,7 @@ ulseek(off_t const offset, int const whence)
return file_ptr - file_map; return file_ptr - file_map;
} }
static ssize_t static ssize_t uwrite(void const *const buf, size_t const count)
uwrite(void const *const buf, size_t const count)
{ {
size_t cnt = count; size_t cnt = count;
off_t idx = 0; off_t idx = 0;
...@@ -127,8 +124,7 @@ uwrite(void const *const buf, size_t const count) ...@@ -127,8 +124,7 @@ uwrite(void const *const buf, size_t const count)
return count; return count;
} }
static void * static void * umalloc(size_t size)
umalloc(size_t size)
{ {
void *const addr = malloc(size); void *const addr = malloc(size);
if (addr == 0) { if (addr == 0) {
...@@ -394,8 +390,7 @@ static uint32_t (*w)(uint32_t); ...@@ -394,8 +390,7 @@ static uint32_t (*w)(uint32_t);
static uint32_t (*w2)(uint16_t); static uint32_t (*w2)(uint16_t);
/* Names of the sections that could contain calls to mcount. */ /* Names of the sections that could contain calls to mcount. */
static int static int is_mcounted_section_name(char const *const txtname)
is_mcounted_section_name(char const *const txtname)
{ {
return strncmp(".text", txtname, 5) == 0 || return strncmp(".text", txtname, 5) == 0 ||
strcmp(".init.text", txtname) == 0 || strcmp(".init.text", txtname) == 0 ||
...@@ -448,8 +443,7 @@ static void MIPS64_r_info(Elf64_Rel *const rp, unsigned sym, unsigned type) ...@@ -448,8 +443,7 @@ static void MIPS64_r_info(Elf64_Rel *const rp, unsigned sym, unsigned type)
}).r_info; }).r_info;
} }
static int static int do_file(char const *const fname)
do_file(char const *const fname)
{ {
Elf32_Ehdr *const ehdr = mmap_file(fname); Elf32_Ehdr *const ehdr = mmap_file(fname);
unsigned int reltype = 0; unsigned int reltype = 0;
...@@ -597,8 +591,7 @@ do_file(char const *const fname) ...@@ -597,8 +591,7 @@ do_file(char const *const fname)
return rc; return rc;
} }
int int main(int argc, char *argv[])
main(int argc, char *argv[])
{ {
const char ftrace[] = "/ftrace.o"; const char ftrace[] = "/ftrace.o";
int ftrace_size = sizeof(ftrace) - 1; int ftrace_size = sizeof(ftrace) - 1;
......
...@@ -468,11 +468,10 @@ static int find_secsym_ndx(unsigned const txtndx, ...@@ -468,11 +468,10 @@ static int find_secsym_ndx(unsigned const txtndx,
} }
/* Evade ISO C restriction: no declaration after statement in has_rel_mcount. */ /* Evade ISO C restriction: no declaration after statement in has_rel_mcount. */
static char const * static char const * __has_rel_mcount(Elf_Shdr const *const relhdr, /* reltype */
__has_rel_mcount(Elf_Shdr const *const relhdr, /* is SHT_REL or SHT_RELA */ Elf_Shdr const *const shdr0,
Elf_Shdr const *const shdr0, char const *const shstrtab,
char const *const shstrtab, char const *const fname)
char const *const fname)
{ {
/* .sh_info depends on .sh_type == SHT_REL[,A] */ /* .sh_info depends on .sh_type == SHT_REL[,A] */
Elf_Shdr const *const txthdr = &shdr0[w(relhdr->sh_info)]; Elf_Shdr const *const txthdr = &shdr0[w(relhdr->sh_info)];
...@@ -524,8 +523,8 @@ static unsigned tot_relsize(Elf_Shdr const *const shdr0, ...@@ -524,8 +523,8 @@ static unsigned tot_relsize(Elf_Shdr const *const shdr0,
/* Overall supervision for Elf32 ET_REL file. */ /* Overall supervision for Elf32 ET_REL file. */
static int static int do_func(Elf_Ehdr *const ehdr, char const *const fname,
do_func(Elf_Ehdr *const ehdr, char const *const fname, unsigned const reltype) unsigned const reltype)
{ {
Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff)
+ (void *)ehdr); + (void *)ehdr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment