diff options
author | smh <smh@FreeBSD.org> | 2016-01-12 02:17:39 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2016-01-12 02:17:39 +0000 |
commit | 5bfbb8e2e501c2ed4209fb168e9878e598acc192 (patch) | |
tree | 4520281a4158d809c8e552821a3d2ed21e225359 /sys/boot/common/load_elf_obj.c | |
parent | 0517d6cfae2a854c90ccf67ec23cfa18945a67ac (diff) | |
download | FreeBSD-src-5bfbb8e2e501c2ed4209fb168e9878e598acc192.zip FreeBSD-src-5bfbb8e2e501c2ed4209fb168e9878e598acc192.tar.gz |
Enable warnings in EFI boot code
Set WARNS if not set for EFI boot code and fix the issues highlighted by
setting it.
Most components are set to WARNS level 6 with few being left at lower
levels due to the amount of changes needed to fix at higher levels.
Error types fixed:
* Missing / invalid casts
* Missing inner structs
* Unused vars
* Missing static for internal only funcs
* Missing prototypes
* Alignment changes
* Use of uninitialised vars
* Unknown pragma (intrinsic)
* Missing types etc due to missing includes
* printf formatting types
Reviewed by: emaste (in part)
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4839
Diffstat (limited to 'sys/boot/common/load_elf_obj.c')
-rw-r--r-- | sys/boot/common/load_elf_obj.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/boot/common/load_elf_obj.c b/sys/boot/common/load_elf_obj.c index 453bb79..869f020 100644 --- a/sys/boot/common/load_elf_obj.c +++ b/sys/boot/common/load_elf_obj.c @@ -520,10 +520,8 @@ __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx) { Elf_Sym sym; Elf_Addr base; - int symcnt; - symcnt = ef->e_shdr[ef->symtabindex].sh_size / sizeof(Elf_Sym); - if (symidx >= symcnt) + if (symidx >= ef->e_shdr[ef->symtabindex].sh_size / sizeof(Elf_Sym)) return (0); COPYOUT(ef->e_shdr[ef->symtabindex].sh_addr + symidx * sizeof(Elf_Sym), &sym, sizeof(sym)); |