Skip to content

Commit

Permalink
lib-extablec-use-bsearch-library-function-in-search_extable-checkpatc…
Browse files Browse the repository at this point in the history
…h-fixes

WARNING: line over 80 characters
torvalds#42: FILE: kernel/extable.c:58:
+	e = search_extable(__start___ex_table, __stop___ex_table - __start___ex_table, addr);

ERROR: "foo * bar" should be "foo *bar"
torvalds#94: FILE: lib/extable.c:100:
+	const struct exception_table_entry * _elt = elt;

ERROR: "(foo*)" should be "(foo *)"
torvalds#95: FILE: lib/extable.c:101:
+	unsigned long k = *(unsigned long*) key;

WARNING: line over 80 characters
torvalds#132: FILE: lib/extable.c:123:
+	return bsearch(&value, first, num, sizeof(struct exception_table_entry), cmp_ex_search);

total: 2 errors, 2 warnings, 100 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/lib-extablec-use-bsearch-library-function-in-search_extable.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: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
akpm00 authored and sfrothwell committed Jun 16, 2017
1 parent 2227851 commit d5ac128
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion kernel/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
{
const struct exception_table_entry *e;

e = search_extable(__start___ex_table, __stop___ex_table - __start___ex_table, addr);
e = search_extable(__start___ex_table,
__stop___ex_table - __start___ex_table, addr);
if (!e)
e = search_module_extables(addr);
return e;
Expand Down
7 changes: 4 additions & 3 deletions lib/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ void trim_init_extable(struct module *m)

static int cmp_ex_search(const void *key, const void *elt)
{
const struct exception_table_entry * _elt = elt;
unsigned long k = *(unsigned long*) key;
const struct exception_table_entry *_elt = elt;
unsigned long k = *(unsigned long *)key;

/* avoid overflow */
if (k > ex_to_insn(_elt))
Expand All @@ -120,6 +120,7 @@ search_extable(const struct exception_table_entry *first,
const size_t num,
unsigned long value)
{
return bsearch(&value, first, num, sizeof(struct exception_table_entry), cmp_ex_search);
return bsearch(&value, first, num,
sizeof(struct exception_table_entry), cmp_ex_search);
}
#endif

0 comments on commit d5ac128

Please sign in to comment.