From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Jessica Yu <jeyu@kernel.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] module: remove unneeded casts in cmp_name()
Date: Mon, 9 Sep 2019 20:39:02 +0900 [thread overview]
Message-ID: <20190909113902.3096-1-yamada.masahiro@socionext.com> (raw)
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
next reply other threads:[~2019-09-09 11:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-09 11:39 Masahiro Yamada [this message]
2019-09-11 12:30 ` [PATCH] module: remove unneeded casts in cmp_name() Jessica Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190909113902.3096-1-yamada.masahiro@socionext.com \
--to=yamada.masahiro@socionext.com \
--cc=jeyu@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).