diff options
author | Mohan <mohan@in.ibm.com> | 2006-07-27 11:16:39 -0600 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2006-07-27 11:16:39 -0600 |
commit | 742b147db61c45cc00db63eea7b23d0a462e56c8 (patch) | |
tree | 241f8411f101176ae6a02163641891371a75c42c | |
parent | ad0f10320e3393d7ca699ac5bcc81726994220c7 (diff) |
Cleanup the warnings in gcc-4.1.0 compilation
Cleanup the warnings generated in GCC 4.1.0 compilation of kexec-tools.
This patch is created on top of the following level of
kexec-tools:
- kexec-tools-1.101.tar.gz (from eric biederman's site or
from lse site)
- kexec-tools-1.101-kdump6.patch (consolidated patch posted
on
http://lse.sourceforge.net/kdump/patches/1.101-kdump6/kexec-tools-1.101-kdump6.patch)
Review and suggestions are welcome.
Note:
Resending the patch since its not delivered to both fastboot and
linuxppc64-dev mailing list.
Regards,
Mohan.
Signed-off-by: Mohan <mohan@in.ibm.com>
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
-rw-r--r-- | kdump/kdump.c | 2 | ||||
-rw-r--r-- | kexec/arch/ppc64/crashdump-ppc64.h | 2 | ||||
-rw-r--r-- | kexec/arch/ppc64/kexec-elf-ppc64.c | 16 | ||||
-rw-r--r-- | kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 3 | ||||
-rw-r--r-- | kexec/arch/ppc64/kexec-zImage-ppc64.c | 2 | ||||
-rw-r--r-- | kexec/kexec-elf-rel.c | 4 | ||||
-rw-r--r-- | kexec/kexec-elf.c | 6 |
7 files changed, 20 insertions, 15 deletions
diff --git a/kdump/kdump.c b/kdump/kdump.c index 6745982..e3a7c99 100644 --- a/kdump/kdump.c +++ b/kdump/kdump.c @@ -54,7 +54,7 @@ static void *xmalloc(size_t size) result = malloc(size); if (result == NULL) { fprintf(stderr, "malloc of %u bytes failed: %s\n", - size, strerror(errno)); + (unsigned int)size, strerror(errno)); exit(7); } return result; diff --git a/kexec/arch/ppc64/crashdump-ppc64.h b/kexec/arch/ppc64/crashdump-ppc64.h index 76c05fe..8f4fa30 100644 --- a/kexec/arch/ppc64/crashdump-ppc64.h +++ b/kexec/arch/ppc64/crashdump-ppc64.h @@ -25,7 +25,9 @@ void add_exclude_rgns(unsigned long long base, unsigned long long size); #define KDUMP_BACKUP_LIMIT 0x8000 #define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) #define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) +#ifndef PAGE_SIZE #define PAGE_SIZE 4096 +#endif extern unsigned long long crash_base; extern unsigned long long crash_size; diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c index 50a59f5..0c2201a 100644 --- a/kexec/arch/ppc64/kexec-elf-ppc64.c +++ b/kexec/arch/ppc64/kexec-elf-ppc64.c @@ -198,15 +198,15 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, seg_buf = NULL; seg_size = 0; - seg_buf = (char *) malloc(purgatory_size); + seg_buf = (unsigned char *) malloc(purgatory_size); if (seg_buf == NULL) { free_elf_info(&ehdr); return -1; } memcpy(seg_buf, purgatory, purgatory_size); seg_size = purgatory_size; - elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size, - 0, max_addr, 1); + elf_rel_build_load(info, &info->rhdr, (const char *)purgatory, + purgatory_size, 0, max_addr, 1); /* Add a ram-disk to the current image * Note: Add the ramdisk after elf_rel_build_load @@ -217,7 +217,7 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, "Can't use ramdisk with device tree blob input\n"); return -1; } - seg_buf = slurp_file(ramdisk, &seg_size); + seg_buf = (unsigned char *)slurp_file(ramdisk, &seg_size); add_buffer(info, seg_buf, seg_size, seg_size, 0, 0, max_addr, 1); hole_addr = (unsigned long long) info->segment[info->nr_segments-1].mem; @@ -231,7 +231,8 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, off_t blob_size = 0; /* Grab device tree from buffer */ - blob_buf = slurp_file(devicetreeblob, &blob_size); + blob_buf = + (unsigned char *)slurp_file(devicetreeblob, &blob_size); add_buffer(info, blob_buf, blob_size, blob_size, 0, 0, max_addr, -1); @@ -239,7 +240,8 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, /* create from fs2dt */ seg_buf = NULL; seg_size = 0; - create_flatten_tree(info, &seg_buf, &seg_size, cmdline); + create_flatten_tree(info, (unsigned char **)&seg_buf, + (unsigned long *)&seg_size,cmdline); add_buffer(info, seg_buf, seg_size, seg_size, 0, 0, max_addr, -1); } @@ -250,7 +252,7 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, */ bb_ptr = (struct bootblock *)( (unsigned char *)info->segment[(info->nr_segments)-1].buf); - rsvmap_ptr = (long long *)( + rsvmap_ptr = (unsigned long long *)( (unsigned char *)info->segment[(info->nr_segments)-1].buf + bb_ptr->off_mem_rsvmap); while (*rsvmap_ptr || *(rsvmap_ptr+1)) diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c index a62552c..a0d1750 100644 --- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c +++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c @@ -26,7 +26,8 @@ static struct mem_shdr *toc_section(const struct mem_ehdr *ehdr) shdr_end = &ehdr->e_shdr[ehdr->e_shnum]; for(shdr = ehdr->e_shdr; shdr != shdr_end; shdr++) if ( shdr->sh_size && - strcmp(&strtab[shdr->sh_name], ".toc") == 0) + strcmp((char *)&strtab[shdr->sh_name], + ".toc") == 0) return shdr; return NULL; } diff --git a/kexec/arch/ppc64/kexec-zImage-ppc64.c b/kexec/arch/ppc64/kexec-zImage-ppc64.c index 697a4db..b6718e8 100644 --- a/kexec/arch/ppc64/kexec-zImage-ppc64.c +++ b/kexec/arch/ppc64/kexec-zImage-ppc64.c @@ -162,7 +162,7 @@ int zImage_ppc64_load(FILE *file, int argc, char **argv, void **ret_entry, segment->mem = (void *) load_loc; segment->memsz = memsize; segment->bufsz = filesize; - *ret_entry = elf.e_entry; + *ret_entry = (void *)((uint64_t)elf.e_entry); *ret_nr_segments = i - 1; free(ph); return 0; diff --git a/kexec/kexec-elf-rel.c b/kexec/kexec-elf-rel.c index eed6bc2..b55d2c2 100644 --- a/kexec/kexec-elf-rel.c +++ b/kexec/kexec-elf-rel.c @@ -417,7 +417,7 @@ void elf_rel_build_load(struct kexec_info *info, struct mem_ehdr *ehdr, int result; /* Parse the Elf file */ - result = build_elf_rel_info(purgatory, purgatory_size, ehdr); + result = build_elf_rel_info((char *)purgatory, purgatory_size, ehdr); if (result < 0) { die("ELF rel parse failed\n"); } @@ -450,7 +450,7 @@ int elf_rel_find_symbol(struct mem_ehdr *ehdr, /* Invalid strtab section number? */ continue; } - strtab = ehdr->e_shdr[shdr->sh_link].sh_data; + strtab = (char *)ehdr->e_shdr[shdr->sh_link].sh_data; /* Walk through the symbol table and find the symbol */ sym_size = elf_sym_size(ehdr); sym_end = shdr->sh_data + shdr->sh_size; diff --git a/kexec/kexec-elf.c b/kexec/kexec-elf.c index 021bca9..da2c788 100644 --- a/kexec/kexec-elf.c +++ b/kexec/kexec-elf.c @@ -648,7 +648,7 @@ static int build_mem_shdrs(const char *buf, off_t len, struct mem_ehdr *ehdr) return -1; } /* Remember where the section lives in the buffer */ - shdr->sh_data = buf + shdr->sh_offset; + shdr->sh_data = (unsigned char *)(buf + shdr->sh_offset); } return 0; } @@ -672,7 +672,7 @@ static int build_mem_notes(const char *buf, off_t len, struct mem_ehdr *ehdr) for(i = 0; !note_start && (i < ehdr->e_phnum); i++) { struct mem_phdr *phdr = &ehdr->e_phdr[i]; if (phdr->p_type == PT_NOTE) { - note_start = phdr->p_data; + note_start = (unsigned char *)phdr->p_data; note_end = note_start + phdr->p_filesz; } } @@ -713,7 +713,7 @@ static int build_mem_notes(const char *buf, off_t len, struct mem_ehdr *ehdr) die("Note name is not null termiated"); } ehdr->e_note[i].n_type = hdr.n_type; - ehdr->e_note[i].n_name = name; + ehdr->e_note[i].n_name = (char *)name; ehdr->e_note[i].n_desc = desc; ehdr->e_note[i].n_descsz = hdr.n_descsz; |