mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Jessica Yu <jeyu@kernel.org>
Cc: Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] module: Do not paper over type mismatches in module_param_call()
Date: Tue, 17 Oct 2017 19:04:43 -0700	[thread overview]
Message-ID: <1508292283-140003-4-git-send-email-keescook@chromium.org> (raw)
In-Reply-To: <1508292283-140003-1-git-send-email-keescook@chromium.org>

The module_param_call() macro was explicitly casting the .set and
.get function prototypes away. This can lead to hard-to-find type
mismatches. Now that all the function prototypes have been fixed
tree-wide, we can drop these casts, and use named initializers too.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 include/linux/moduleparam.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 037a90a522a5..20386252fe3e 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -227,9 +227,9 @@ struct kparam_array
 	    VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }
 
 /* Obsolete - use module_param_cb() */
-#define module_param_call(name, set, get, arg, perm)			\
+#define module_param_call(name, _set, _get, arg, perm)			\
 	static const struct kernel_param_ops __param_ops_##name =	\
-		{ .flags = 0, (void *)set, (void *)get };		\
+		{ .flags = 0, .set = _set, .get = _get };		\
 	__module_param_call(MODULE_PARAM_PREFIX,			\
 			    name, &__param_ops_##name, arg, perm, -1, 0)
 
-- 
2.7.4

  parent reply	other threads:[~2017-10-18  2:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18  2:04 [RESEND][PATCH 0/3] " Kees Cook
2017-10-18  2:04 ` [PATCH 1/3] module: Prepare to convert all module_param_call() prototypes Kees Cook
2017-10-18  2:04 ` [PATCH 2/3] treewide: Fix function prototypes for module_param_call() Kees Cook
2017-10-18  2:04 ` Kees Cook [this message]
2017-10-18 10:12 ` [RESEND][PATCH 0/3] module: Do not paper over type mismatches in module_param_call() Arnd Bergmann
2017-10-18 14:21   ` Kees Cook
2017-10-30 21:20 ` Kees Cook
2017-10-31 14:46   ` Jessica Yu
  -- strict thread matches above, loose matches on Subject: below --
2017-10-18  2:01 [PATCH 0/3] " Kees Cook
2017-10-18  2:01 ` [PATCH 3/3] " Kees Cook

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=1508292283-140003-4-git-send-email-keescook@chromium.org \
    --to=keescook@chromium.org \
    --cc=arnd@arndb.de \
    --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

all inboxes | Powered by JetHome®