linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] module: remove unneeded casts in cmp_name()
@ 2019-09-09 11:39 Masahiro Yamada
  2019-09-11 12:30 ` Jessica Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2019-09-09 11:39 UTC (permalink / raw)
  To: Jessica Yu; +Cc: Masahiro Yamada, linux-kernel

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(-)

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,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] module: remove unneeded casts in cmp_name()
  2019-09-09 11:39 [PATCH] module: remove unneeded casts in cmp_name() Masahiro Yamada
@ 2019-09-11 12:30 ` Jessica Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Jessica Yu @ 2019-09-11 12:30 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kernel

+++ 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-11 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09 11:39 [PATCH] module: remove unneeded casts in cmp_name() Masahiro Yamada
2019-09-11 12:30 ` Jessica Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).