Skip to content

Commit

Permalink
powerpc-adapt-elf64_apply_relocate_add-for-kexec_file_load-checkpatch…
Browse files Browse the repository at this point in the history
…-fixes

WARNING: line over 80 characters
torvalds#111: FILE: arch/powerpc/kernel/elf_util_64.c:141:
+				pr_err("Symbol '%s' in common section.\n", name);

WARNING: else is not generally useful after a break or return
torvalds#121: FILE: arch/powerpc/kernel/elf_util_64.c:151:
+				return -ENOEXEC;
+			} else {

WARNING: line over 80 characters
torvalds#143: FILE: arch/powerpc/kernel/elf_util_64.c:174:
+			*(uint32_t *)location = value - (uint32_t)(uint64_t)location;

WARNING: line over 80 characters
torvalds#172: FILE: arch/powerpc/kernel/elf_util_64.c:249:
+				pr_err("%s: REL14 %li out of range!\n", obj_name,

total: 0 errors, 4 warnings, 196 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/powerpc-adapt-elf64_apply_relocate_add-for-kexec_file_load.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
akpm00 authored and hnaz committed Aug 26, 2016
1 parent 01982e5 commit 411fcb2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/powerpc/kernel/elf_util_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ int elf64_apply_relocate_add(const struct elf_info *elf_info,
pr_err("Undefined symbol: %s\n", name);
return -ENOEXEC;
} else if (sym->st_shndx == SHN_COMMON) {
pr_err("Symbol '%s' in common section.\n", name);
pr_err("Symbol '%s' in common section.\n",
name);
return -ENOEXEC;
}
}
Expand Down Expand Up @@ -173,7 +174,8 @@ int elf64_apply_relocate_add(const struct elf_info *elf_info,
break;

case R_PPC64_REL32:
*(uint32_t *)location = value - (uint32_t)(uint64_t)location;
*(uint32_t *)location =
value - (uint32_t)(uint64_t)location;
break;

case R_PPC64_TOC:
Expand Down Expand Up @@ -248,8 +250,8 @@ int elf64_apply_relocate_add(const struct elf_info *elf_info,
/* Convert value to relative */
value -= address;
if (value + 0x8000 > 0xffff || (value & 3) != 0) {
pr_err("%s: REL14 %li out of range!\n", obj_name,
(long int)value);
pr_err("%s: REL14 %li out of range!\n",
obj_name, (long int)value);
return -ENOEXEC;
}

Expand Down

0 comments on commit 411fcb2

Please sign in to comment.