Skip to content

Commit 3aec863

Browse files
Matt Helsleyrostedt
authored andcommitted
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.com Signed-off-by: Matt Helsley <mhelsley@vmware.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 3f1df12 commit 3aec863

2 files changed

Lines changed: 13 additions & 21 deletions

File tree

‎scripts/recordmcount.c‎

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ static void *file_append; /* added to the end of the file */
5252
static size_t file_append_size; /* how much is added to end of file */
5353

5454
/* Per-file resource cleanup when multiple files. */
55-
static void
56-
cleanup(void)
55+
static void cleanup(void)
5756
{
5857
if (!mmap_failed)
5958
munmap(file_map, sb.st_size);
@@ -68,8 +67,7 @@ cleanup(void)
6867

6968
/* ulseek, uwrite, ...: Check return value for errors. */
7069

71-
static off_t
72-
ulseek(off_t const offset, int const whence)
70+
static off_t ulseek(off_t const offset, int const whence)
7371
{
7472
switch (whence) {
7573
case SEEK_SET:
@@ -89,8 +87,7 @@ ulseek(off_t const offset, int const whence)
8987
return file_ptr - file_map;
9088
}
9189

92-
static ssize_t
93-
uwrite(void const *const buf, size_t const count)
90+
static ssize_t uwrite(void const *const buf, size_t const count)
9491
{
9592
size_t cnt = count;
9693
off_t idx = 0;
@@ -127,8 +124,7 @@ uwrite(void const *const buf, size_t const count)
127124
return count;
128125
}
129126

130-
static void *
131-
umalloc(size_t size)
127+
static void * umalloc(size_t size)
132128
{
133129
void *const addr = malloc(size);
134130
if (addr == 0) {
@@ -394,8 +390,7 @@ static uint32_t (*w)(uint32_t);
394390
static uint32_t (*w2)(uint16_t);
395391

396392
/* Names of the sections that could contain calls to mcount. */
397-
static int
398-
is_mcounted_section_name(char const *const txtname)
393+
static int is_mcounted_section_name(char const *const txtname)
399394
{
400395
return strncmp(".text", txtname, 5) == 0 ||
401396
strcmp(".init.text", txtname) == 0 ||
@@ -448,8 +443,7 @@ static void MIPS64_r_info(Elf64_Rel *const rp, unsigned sym, unsigned type)
448443
}).r_info;
449444
}
450445

451-
static int
452-
do_file(char const *const fname)
446+
static int do_file(char const *const fname)
453447
{
454448
Elf32_Ehdr *const ehdr = mmap_file(fname);
455449
unsigned int reltype = 0;
@@ -597,8 +591,7 @@ do_file(char const *const fname)
597591
return rc;
598592
}
599593

600-
int
601-
main(int argc, char *argv[])
594+
int main(int argc, char *argv[])
602595
{
603596
const char ftrace[] = "/ftrace.o";
604597
int ftrace_size = sizeof(ftrace) - 1;

‎scripts/recordmcount.h‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,10 @@ static int find_secsym_ndx(unsigned const txtndx,
468468
}
469469

470470
/* Evade ISO C restriction: no declaration after statement in has_rel_mcount. */
471-
static char const *
472-
__has_rel_mcount(Elf_Shdr const *const relhdr, /* is SHT_REL or SHT_RELA */
473-
Elf_Shdr const *const shdr0,
474-
char const *const shstrtab,
475-
char const *const fname)
471+
static char const * __has_rel_mcount(Elf_Shdr const *const relhdr, /* reltype */
472+
Elf_Shdr const *const shdr0,
473+
char const *const shstrtab,
474+
char const *const fname)
476475
{
477476
/* .sh_info depends on .sh_type == SHT_REL[,A] */
478477
Elf_Shdr const *const txthdr = &shdr0[w(relhdr->sh_info)];
@@ -524,8 +523,8 @@ static unsigned tot_relsize(Elf_Shdr const *const shdr0,
524523

525524

526525
/* Overall supervision for Elf32 ET_REL file. */
527-
static int
528-
do_func(Elf_Ehdr *const ehdr, char const *const fname, unsigned const reltype)
526+
static int do_func(Elf_Ehdr *const ehdr, char const *const fname,
527+
unsigned const reltype)
529528
{
530529
Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff)
531530
+ (void *)ehdr);

0 commit comments

Comments
 (0)