Skip to content

Commit d5ac128

Browse files
akpm00sfrothwell
authored andcommitted
lib-extablec-use-bsearch-library-function-in-search_extable-checkpatch-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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2227851 commit d5ac128

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

kernel/extable.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
5555
{
5656
const struct exception_table_entry *e;
5757

58-
e = search_extable(__start___ex_table, __stop___ex_table - __start___ex_table, addr);
58+
e = search_extable(__start___ex_table,
59+
__stop___ex_table - __start___ex_table, addr);
5960
if (!e)
6061
e = search_module_extables(addr);
6162
return e;

lib/extable.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ void trim_init_extable(struct module *m)
9797

9898
static int cmp_ex_search(const void *key, const void *elt)
9999
{
100-
const struct exception_table_entry * _elt = elt;
101-
unsigned long k = *(unsigned long*) key;
100+
const struct exception_table_entry *_elt = elt;
101+
unsigned long k = *(unsigned long *)key;
102102

103103
/* avoid overflow */
104104
if (k > ex_to_insn(_elt))
@@ -120,6 +120,7 @@ search_extable(const struct exception_table_entry *first,
120120
const size_t num,
121121
unsigned long value)
122122
{
123-
return bsearch(&value, first, num, sizeof(struct exception_table_entry), cmp_ex_search);
123+
return bsearch(&value, first, num,
124+
sizeof(struct exception_table_entry), cmp_ex_search);
124125
}
125126
#endif

0 commit comments

Comments
 (0)