From: "Christoph Egger" Subject: [PATCH] Cleanup xen/common/elf.c Date: Fri, 19 Jan 2007 14:52:10 +0100 Message-ID: <200701191452.10849.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_K0MsFEPSdZtKiX1" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_K0MsFEPSdZtKiX1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! Attached patch avoids void * arithmetic. Christoph Egger --Boundary-00=_K0MsFEPSdZtKiX1 Content-Type: text/x-diff; charset=us-ascii; name=xen_elf.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=xen_elf.diff diff -r e2539ab3580a xen/common/elf.c --- a/xen/common/elf.c Thu Jan 18 18:54:28 2007 +0000 +++ b/xen/common/elf.c Thu Jan 18 14:02:57 2007 +0100 @@ -102,7 +102,7 @@ static unsigned long long xen_guest_nume /* * Interface to the Xen ELF notes. */ -#define ELFNOTE_NAME(_n_) ((const void*)(_n_) + sizeof(*(_n_))) +#define ELFNOTE_NAME(_n_) ((const char*)(_n_) + sizeof(*(_n_))) #define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + (((_n_)->namesz+3)&~3)) #define ELFNOTE_NEXT(_n_) (ELFNOTE_DESC(_n_) + (((_n_)->descsz+3)&~3)) @@ -115,7 +115,7 @@ static int is_xen_elfnote_section(const for ( note = (const Elf_Note *)(image + shdr->sh_offset); note < (const Elf_Note *)(image + shdr->sh_offset + shdr->sh_size); - note = ELFNOTE_NEXT(note) ) + note = (const Elf_Note *)ELFNOTE_NEXT(note) ) { if ( !strncmp(ELFNOTE_NAME(note), "Xen", 4) ) return 1; @@ -134,7 +134,7 @@ static const Elf_Note *xen_elfnote_looku for ( note = (const Elf_Note *)dsi->__elfnote_section; note < (const Elf_Note *)dsi->__elfnote_section_end; - note = ELFNOTE_NEXT(note) ) + note = (const Elf_Note *)ELFNOTE_NEXT(note) ) { if ( strncmp(ELFNOTE_NAME(note), "Xen", 4) ) continue; @@ -227,9 +227,9 @@ int parseelfimage(struct domain_setup_in image + ehdr->e_shoff + (h*ehdr->e_shentsize)); if ( !is_xen_elfnote_section(image, shdr) ) continue; - dsi->__elfnote_section = (const void *)image + shdr->sh_offset; + dsi->__elfnote_section = (const char *)image + shdr->sh_offset; dsi->__elfnote_section_end = - (const void *)image + shdr->sh_offset + shdr->sh_size; + (const char *)image + shdr->sh_offset + shdr->sh_size; break; } --Boundary-00=_K0MsFEPSdZtKiX1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_K0MsFEPSdZtKiX1--