All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amerigo Wang <amwang@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
	roland@redhat.com, serue@us.ibm.com, dhowells@redhat.com,
	jmorris@namei.org, linux-fsdevel@vger.kernel.org
Subject: Re: [Patch 2/3] elf: clean up fill_note_info()
Date: Thu, 02 Jul 2009 17:40:26 +0800	[thread overview]
Message-ID: <4A4C808A.9010302@redhat.com> (raw)
In-Reply-To: <20090701122955.da45e073.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Wed, 1 Jul 2009 01:06:36 -0400
> Amerigo Wang <amwang@redhat.com> wrote:
>
>   
>> +#define	NUM_NOTES	6
>>  	info->notes = kmalloc(NUM_NOTES * sizeof(struct memelfnote),
>>  			      GFP_KERNEL);
>> +#undef NUM_NOTES
>>     
>
> That #define amounts to a really perverse code comment.
>
> How about we do this?
>   


Ah, better! No problem for me.

Thank you!
> --- a/fs/binfmt_elf.c~elf-clean-up-fill_note_info-fix
> +++ a/fs/binfmt_elf.c
> @@ -1719,10 +1719,8 @@ static int elf_note_info_init(struct elf
>  	memset(info, 0, sizeof(*info));
>  	INIT_LIST_HEAD(&info->thread_list);
>  
> -#define	NUM_NOTES	6
> -	info->notes = kmalloc(NUM_NOTES * sizeof(struct memelfnote),
> -			      GFP_KERNEL);
> -#undef NUM_NOTES
> +	/* Allocate space for six ELF notes */
> +	info->notes = kmalloc(6 * sizeof(struct memelfnote), GFP_KERNEL);
>  	if (!info->notes)
>  		return 0;
>  	info->psinfo = kmalloc(sizeof(*info->psinfo), GFP_KERNEL);
> _
>
>   


  reply	other threads:[~2009-07-02  9:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01  5:06 [Patch 1/3] elf: fix one check-after-use Amerigo Wang
2009-07-01  5:06 ` [Patch 2/3] elf: clean up fill_note_info() Amerigo Wang
2009-07-01 19:29   ` Andrew Morton
2009-07-02  9:40     ` Amerigo Wang [this message]
2009-07-01  5:06 ` [Patch 3/3] elf: use a macro instead of a raw number Amerigo Wang
2009-07-01  7:38   ` Roland McGrath
2009-07-02  9:38     ` Amerigo Wang
2009-07-02  9:55       ` Roland McGrath
2009-07-01  7:39 ` [Patch 1/3] elf: fix one check-after-use Roland McGrath
2009-07-01 15:13 ` James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A4C808A.9010302@redhat.com \
    --to=amwang@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=jmorris@namei.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=serue@us.ibm.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.