mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
treewide: Fix function prototypes for module_param_call()
Several function prototypes for the set/get functions defined by
module_param_call() have a slightly wrong argument types. This fixes
those in an effort to clean up the calls when running under type-enforced
compiler instrumentation for CFI. This is the result of running the
following semantic patch:
@match_module_param_call_function@
declarer name module_param_call;
identifier _name, _set_func, _get_func;
expression _arg, _mode;
@@
module_param_call(_name, _set_func, _get_func, _arg, _mode);
@fix_set_prototype
depends on match_module_param_call_function@
identifier match_module_param_call_function._set_func;
identifier _val, _param;
type _val_type, _param_type;
@@
int _set_func(
-_val_type _val
+const char * _val
,
-_param_type _param
+const struct kernel_param * _param
) { ... }
@fix_get_prototype
depends on match_module_param_call_function@
identifier match_module_param_call_function._get_func;
identifier _val, _param;
type _val_type, _param_type;
@@
int _get_func(
-_val_type _val
+char * _val
,
-_param_type _param
+const struct kernel_param * _param
) { ... }
Two additional by-hand changes are included for places where the above
Coccinelle script didn't notice them:
drivers/platform/x86/thinkpad_acpi.c
fs/lockd/svc.c
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Jessica Yu <[email protected]>
This commit is contained in:
parent
b2f270e874
commit
e4dca7b7aa
42 changed files with 87 additions and 72 deletions
|
|
@ -34,7 +34,8 @@ module_param(emulate_scroll_wheel, bool, 0644);
|
|||
MODULE_PARM_DESC(emulate_scroll_wheel, "Emulate a scroll wheel");
|
||||
|
||||
static unsigned int scroll_speed = 32;
|
||||
static int param_set_scroll_speed(const char *val, struct kernel_param *kp) {
|
||||
static int param_set_scroll_speed(const char *val,
|
||||
const struct kernel_param *kp) {
|
||||
unsigned long speed;
|
||||
if (!val || kstrtoul(val, 0, &speed) || speed > 63)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue