From: Ian Campbell Subject: Re: [PATCH] Cleanup for xen/common/kexec.c Date: Mon, 22 Jan 2007 11:57:06 +0000 Message-ID: <1169467026.6453.29.camel@localhost.localdomain> References: <200701221048.53313.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200701221048.53313.Christoph.Egger@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Christoph Egger Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Mon, 2007-01-22 at 10:48 +0100, Christoph Egger wrote: > #define ELFNOTE_ALIGN(_n_) (((_n_)+3)&~3) > -#define ELFNOTE_NAME(_n_) ((void*)(_n_) + sizeof(*(_n_))) > +#define ELFNOTE_NAME(_n_) ((char*)(_n_) + sizeof(*(_n_))) > #define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz)) > #define ELFNOTE_NEXT(_n_) (ELFNOTE_DESC(_n_) + ELFNOTE_ALIGN((_n_)->descsz)) > > @@ -75,10 +75,10 @@ void kexec_crash_save_cpu(void) > if ( cpu_test_and_set(cpu, crash_saved_cpus) ) > return; > > - prstatus = ELFNOTE_DESC(note); > - > - note = ELFNOTE_NEXT(note); > - xencore = ELFNOTE_DESC(note); > + prstatus = (ELF_Prstatus *)ELFNOTE_DESC(note); > + > + note = (Elf_Note *)ELFNOTE_NEXT(note); Perhaps you could include the cast in the ELFNOTE_NEXT() macro instead of repeating it everywhere it is used? Also, could the elfnote macros could be moved to a header? They are used in xen/common/elf.c too. Ian.