diff mbox series

module: remove unneeded casts in cmp_name()

Message ID 20190909113902.3096-1-yamada.masahiro@socionext.com
State Accepted
Commit b605be658188005efd2d447e0989fd1f4aab8862
Headers show
Series module: remove unneeded casts in cmp_name() | expand

Commit Message

Masahiro Yamada Sept. 9, 2019, 11:39 a.m. UTC
You can pass opaque pointers directly.

I also renamed 'va' and 'vb' into more meaningful arguments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

 kernel/module.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

-- 
2.17.1

Comments

Jessica Yu Sept. 11, 2019, 12:30 p.m. UTC | #1
+++ Masahiro Yamada [09/09/19 20:39 +0900]:
>You can pass opaque pointers directly.

>

>I also renamed 'va' and 'vb' into more meaningful arguments.

>

>Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


Looks good, I'll queue this up in modules-next.

Thanks!

Jessica
diff mbox series

Patch

diff --git a/kernel/module.c b/kernel/module.c
index 62e49ead0237..a2db612d039e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -544,12 +544,9 @@  static const char *kernel_symbol_name(const struct kernel_symbol *sym)
 #endif
 }
 
-static int cmp_name(const void *va, const void *vb)
+static int cmp_name(const void *name, const void *sym)
 {
-	const char *a;
-	const struct kernel_symbol *b;
-	a = va; b = vb;
-	return strcmp(a, kernel_symbol_name(b));
+	return strcmp(name, kernel_symbol_name(sym));
 }
 
 static bool find_exported_symbol_in_section(const struct symsearch *syms,