All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: "Ahmed S. Darwish" <darwish.07@gmail.com>
Cc: Haren Myneni <hbabu@us.ibm.com>,
	kexec@lists.infradead.org, Eric Biederman <ebiederm@xmission.com>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH v2] kexec-tools: Don't duplicate the bzImage header area
Date: Thu, 10 Feb 2011 08:25:32 +0900	[thread overview]
Message-ID: <20110209232529.GA6902@verge.net.au> (raw)
In-Reply-To: <20110209111304.GA6972@laptop>

On Wed, Feb 09, 2011 at 01:13:04PM +0200, Ahmed S. Darwish wrote:
> On Wed, Feb 09, 2011 at 07:15:45AM +0900, Simon Horman wrote:
> > On Tue, Feb 08, 2011 at 05:20:36PM +0200, Ahmed S. Darwish wrote:
> > > 
> > > diff --git a/kexec/arch/i386/kexec-bzImage.c b/kexec/arch/i386/kexec-bzImage.c
> > > index 83d3a69..2312eb8 100644
> > > --- a/kexec/arch/i386/kexec-bzImage.c
> > > +++ b/kexec/arch/i386/kexec-bzImage.c
> > > @@ -43,32 +43,32 @@ static const int probe_debug = 0;
> > >  
> > >  int bzImage_probe(const char *buf, off_t len)
> > >  {
> > > -	struct x86_linux_header header;
> > > +	const struct x86_linux_header *header;
> > >  	if ((uintmax_t)len < (uintmax_t)sizeof(header)) {
> > >  		return -1;
> > >  	}
> > > -	memcpy(&header, buf, sizeof(header));
> > > -	if (memcmp(header.header_magic, "HdrS", 4) != 0) {
> > > +	header = (void *)buf;
> > 
> > Perhaps casting to (struct x86_linux_header*) would read better?
> > 
> 
> I felt that '(const struct x86_linux_header *)' is a bit long, but it's
> not a big deal. Attached is the same patch with that line modified:
> 
> ==>
> 
> Don't wholeheartedly copy the 32-Kbytes bzImage header area to the stack,
> just use a constant pointer instead.

Thanks, applied.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2011-02-09 23:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08 15:20 [PATCH] kexec-tools: Don't duplicate the bzImage header area Ahmed S. Darwish
2011-02-08 22:15 ` Simon Horman
2011-02-09 11:13   ` [PATCH v2] " Ahmed S. Darwish
2011-02-09 23:25     ` Simon Horman [this message]

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=20110209232529.GA6902@verge.net.au \
    --to=horms@verge.net.au \
    --cc=darwish.07@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=hbabu@us.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=vgoyal@redhat.com \
    /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.