lkml.org 
[lkml]   [2019]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 08/13] recordmcount: Clarify what cleanup() does
On Wed, 24 Jul 2019 14:05:02 -0700
Matt Helsley <mhelsley@vmware.com> wrote:

> @@ -436,10 +451,11 @@ static void MIPS64_r_info(Elf64_Rel *const rp, unsigned sym, unsigned type)
>
> static int do_file(char const *const fname)
> {
> - Elf32_Ehdr *const ehdr = mmap_file(fname);
> + Elf32_Ehdr *ehdr;
> unsigned int reltype = 0;
> int rc = -1;
>

On small nit that I'm going to tweak, is the ordering of the
declarations above. By removing the const and the assignment, you lost
the "upside-down x-mas tree" look of the declaration.

That is, we went from:

static int do_file(char const *const fname)
{
Elf32_Ehdr *const ehdr = mmap_file(fname);
unsigned int reltype = 0;
int rc = -1;

to:

static int do_file(char const *const fname)
{
Elf32_Ehdr *ehdr;
unsigned int reltype = 0;
int rc = -1;


Which, I'll change to:

static int do_file(char const *const fname)
{
unsigned int reltype = 0;
Elf32_Ehdr *ehdr;
int rc = -1;

-- Steve

\
 
 \ /
  Last update: 2019-07-26 18:14    [W:0.122 / U:2.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site