BACKPORT: 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 <keescook@chromium.org>
Signed-off-by: Jessica Yu <jeyu@kernel.org>

Bug: 67506682
Change-Id: I2c9c0ee8ed28065e63270a52c155e5e7d2791295
(cherry picked from commit e4dca7b7aa08b22893c45485d222b5807c1375ae)
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
Kees Cook 2017-10-17 19:04:42 -07:00 committed by Sami Tolvanen
parent 38cbecf2ae
commit 24da2c84bd
42 changed files with 87 additions and 72 deletions

View file

@ -708,7 +708,7 @@ static void cmm_exit(void)
* Return value: * Return value:
* 0 on success / other on failure * 0 on success / other on failure
**/ **/
static int cmm_set_disable(const char *val, struct kernel_param *kp) static int cmm_set_disable(const char *val, const struct kernel_param *kp)
{ {
int disable = simple_strtoul(val, NULL, 10); int disable = simple_strtoul(val, NULL, 10);

View file

@ -615,7 +615,7 @@ enum __force_cpu_type {
static int force_cpu_type; static int force_cpu_type;
static int set_cpu_type(const char *str, struct kernel_param *kp) static int set_cpu_type(const char *str, const struct kernel_param *kp)
{ {
if (!strcmp(str, "timer")) { if (!strcmp(str, "timer")) {
force_cpu_type = timer; force_cpu_type = timer;

View file

@ -556,7 +556,8 @@ static int acpi_button_remove(struct acpi_device *device)
return 0; return 0;
} }
static int param_set_lid_init_state(const char *val, struct kernel_param *kp) static int param_set_lid_init_state(const char *val,
const struct kernel_param *kp)
{ {
int result = 0; int result = 0;
@ -574,7 +575,8 @@ static int param_set_lid_init_state(const char *val, struct kernel_param *kp)
return result; return result;
} }
static int param_get_lid_init_state(char *buffer, struct kernel_param *kp) static int param_get_lid_init_state(char *buffer,
const struct kernel_param *kp)
{ {
switch (lid_init_state) { switch (lid_init_state) {
case ACPI_BUTTON_LID_INIT_OPEN: case ACPI_BUTTON_LID_INIT_OPEN:

View file

@ -1891,7 +1891,8 @@ static const struct dev_pm_ops acpi_ec_pm = {
SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume) SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume)
}; };
static int param_set_event_clearing(const char *val, struct kernel_param *kp) static int param_set_event_clearing(const char *val,
const struct kernel_param *kp)
{ {
int result = 0; int result = 0;
@ -1909,7 +1910,8 @@ static int param_set_event_clearing(const char *val, struct kernel_param *kp)
return result; return result;
} }
static int param_get_event_clearing(char *buffer, struct kernel_param *kp) static int param_get_event_clearing(char *buffer,
const struct kernel_param *kp)
{ {
switch (ec_event_clearing) { switch (ec_event_clearing) {
case ACPI_EC_EVT_TIMING_STATUS: case ACPI_EC_EVT_TIMING_STATUS:

View file

@ -227,7 +227,8 @@ module_param_cb(trace_method_name, &param_ops_trace_method, &trace_method_name,
module_param_cb(trace_debug_layer, &param_ops_trace_attrib, &acpi_gbl_trace_dbg_layer, 0644); module_param_cb(trace_debug_layer, &param_ops_trace_attrib, &acpi_gbl_trace_dbg_layer, 0644);
module_param_cb(trace_debug_level, &param_ops_trace_attrib, &acpi_gbl_trace_dbg_level, 0644); module_param_cb(trace_debug_level, &param_ops_trace_attrib, &acpi_gbl_trace_dbg_level, 0644);
static int param_set_trace_state(const char *val, struct kernel_param *kp) static int param_set_trace_state(const char *val,
const struct kernel_param *kp)
{ {
acpi_status status; acpi_status status;
const char *method = trace_method_name; const char *method = trace_method_name;
@ -263,7 +264,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
return 0; return 0;
} }
static int param_get_trace_state(char *buffer, struct kernel_param *kp) static int param_get_trace_state(char *buffer, const struct kernel_param *kp)
{ {
if (!(acpi_gbl_trace_flags & ACPI_TRACE_ENABLED)) if (!(acpi_gbl_trace_flags & ACPI_TRACE_ENABLED))
return sprintf(buffer, "disable"); return sprintf(buffer, "disable");
@ -292,7 +293,8 @@ MODULE_PARM_DESC(aml_debug_output,
"To enable/disable the ACPI Debug Object output."); "To enable/disable the ACPI Debug Object output.");
/* /sys/module/acpi/parameters/acpica_version */ /* /sys/module/acpi/parameters/acpica_version */
static int param_get_acpica_version(char *buffer, struct kernel_param *kp) static int param_get_acpica_version(char *buffer,
const struct kernel_param *kp)
{ {
int result; int result;

View file

@ -151,7 +151,7 @@ static DECLARE_WAIT_QUEUE_HEAD(binder_user_error_wait);
static int binder_stop_on_user_error; static int binder_stop_on_user_error;
static int binder_set_stop_on_user_error(const char *val, static int binder_set_stop_on_user_error(const char *val,
struct kernel_param *kp) const struct kernel_param *kp)
{ {
int ret; int ret;

View file

@ -66,7 +66,7 @@ static void (*specific_poweroff_func)(ipmi_user_t user);
/* Holds the old poweroff function so we can restore it on removal. */ /* Holds the old poweroff function so we can restore it on removal. */
static void (*old_poweroff_func)(void); static void (*old_poweroff_func)(void);
static int set_param_ifnum(const char *val, struct kernel_param *kp) static int set_param_ifnum(const char *val, const struct kernel_param *kp)
{ {
int rv = param_set_int(val, kp); int rv = param_set_int(val, kp);
if (rv) if (rv)

View file

@ -1344,7 +1344,7 @@ static unsigned int num_slave_addrs;
#define IPMI_MEM_ADDR_SPACE 1 #define IPMI_MEM_ADDR_SPACE 1
static const char * const addr_space_to_str[] = { "i/o", "mem" }; static const char * const addr_space_to_str[] = { "i/o", "mem" };
static int hotmod_handler(const char *val, struct kernel_param *kp); static int hotmod_handler(const char *val, const struct kernel_param *kp);
module_param_call(hotmod, hotmod_handler, NULL, NULL, 0200); module_param_call(hotmod, hotmod_handler, NULL, NULL, 0200);
MODULE_PARM_DESC(hotmod, "Add and remove interfaces. See" MODULE_PARM_DESC(hotmod, "Add and remove interfaces. See"
@ -1814,7 +1814,7 @@ static struct smi_info *smi_info_alloc(void)
return info; return info;
} }
static int hotmod_handler(const char *val, struct kernel_param *kp) static int hotmod_handler(const char *val, const struct kernel_param *kp)
{ {
char *str = kstrdup(val, GFP_KERNEL); char *str = kstrdup(val, GFP_KERNEL);
int rv; int rv;

View file

@ -50,7 +50,7 @@ int edac_mc_get_poll_msec(void)
return edac_mc_poll_msec; return edac_mc_poll_msec;
} }
static int edac_set_poll_msec(const char *val, struct kernel_param *kp) static int edac_set_poll_msec(const char *val, const struct kernel_param *kp)
{ {
unsigned long l; unsigned long l;
int ret; int ret;

View file

@ -19,7 +19,8 @@
#ifdef CONFIG_EDAC_DEBUG #ifdef CONFIG_EDAC_DEBUG
static int edac_set_debug_level(const char *buf, struct kernel_param *kp) static int edac_set_debug_level(const char *buf,
const struct kernel_param *kp)
{ {
unsigned long val; unsigned long val;
int ret; int ret;

View file

@ -34,7 +34,8 @@ module_param(emulate_scroll_wheel, bool, 0644);
MODULE_PARM_DESC(emulate_scroll_wheel, "Emulate a scroll wheel"); MODULE_PARM_DESC(emulate_scroll_wheel, "Emulate a scroll wheel");
static unsigned int scroll_speed = 32; 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; unsigned long speed;
if (!val || kstrtoul(val, 0, &speed) || speed > 63) if (!val || kstrtoul(val, 0, &speed) || speed > 63)
return -EINVAL; return -EINVAL;

View file

@ -244,7 +244,7 @@ struct chs_geom {
static unsigned int ide_disks; static unsigned int ide_disks;
static struct chs_geom ide_disks_chs[MAX_HWIFS * MAX_DRIVES]; static struct chs_geom ide_disks_chs[MAX_HWIFS * MAX_DRIVES];
static int ide_set_disk_chs(const char *str, struct kernel_param *kp) static int ide_set_disk_chs(const char *str, const struct kernel_param *kp)
{ {
unsigned int a, b, c = 0, h = 0, s = 0, i, j = 1; unsigned int a, b, c = 0, h = 0, s = 0, i, j = 1;
@ -328,7 +328,7 @@ static void ide_dev_apply_params(ide_drive_t *drive, u8 unit)
static unsigned int ide_ignore_cable; static unsigned int ide_ignore_cable;
static int ide_set_ignore_cable(const char *s, struct kernel_param *kp) static int ide_set_ignore_cable(const char *s, const struct kernel_param *kp)
{ {
int i, j = 1; int i, j = 1;

View file

@ -150,7 +150,7 @@ static struct kparam_string kp_txselect = {
.string = txselect_list, .string = txselect_list,
.maxlen = MAX_ATTEN_LEN .maxlen = MAX_ATTEN_LEN
}; };
static int setup_txselect(const char *, struct kernel_param *); static int setup_txselect(const char *, const struct kernel_param *);
module_param_call(txselect, setup_txselect, param_get_string, module_param_call(txselect, setup_txselect, param_get_string,
&kp_txselect, S_IWUSR | S_IRUGO); &kp_txselect, S_IWUSR | S_IRUGO);
MODULE_PARM_DESC(txselect, MODULE_PARM_DESC(txselect,
@ -6177,7 +6177,7 @@ static void set_no_qsfp_atten(struct qib_devdata *dd, int change)
} }
/* handle the txselect parameter changing */ /* handle the txselect parameter changing */
static int setup_txselect(const char *str, struct kernel_param *kp) static int setup_txselect(const char *str, const struct kernel_param *kp)
{ {
struct qib_devdata *dd; struct qib_devdata *dd;
unsigned long val; unsigned long val;

View file

@ -80,7 +80,7 @@ module_param(srpt_srq_size, int, 0444);
MODULE_PARM_DESC(srpt_srq_size, MODULE_PARM_DESC(srpt_srq_size,
"Shared receive queue (SRQ) size."); "Shared receive queue (SRQ) size.");
static int srpt_get_u64_x(char *buffer, struct kernel_param *kp) static int srpt_get_u64_x(char *buffer, const struct kernel_param *kp)
{ {
return sprintf(buffer, "0x%016llx", *(u64 *)kp->arg); return sprintf(buffer, "0x%016llx", *(u64 *)kp->arg);
} }

View file

@ -156,7 +156,7 @@ _set_debug(struct fritzcard *card)
} }
static int static int
set_debug(const char *val, struct kernel_param *kp) set_debug(const char *val, const struct kernel_param *kp)
{ {
int ret; int ret;
struct fritzcard *card; struct fritzcard *card;

View file

@ -244,7 +244,7 @@ _set_debug(struct inf_hw *card)
} }
static int static int
set_debug(const char *val, struct kernel_param *kp) set_debug(const char *val, const struct kernel_param *kp)
{ {
int ret; int ret;
struct inf_hw *card; struct inf_hw *card;

View file

@ -111,7 +111,7 @@ _set_debug(struct tiger_hw *card)
} }
static int static int
set_debug(const char *val, struct kernel_param *kp) set_debug(const char *val, const struct kernel_param *kp)
{ {
int ret; int ret;
struct tiger_hw *card; struct tiger_hw *card;

View file

@ -94,7 +94,7 @@ _set_debug(struct sfax_hw *card)
} }
static int static int
set_debug(const char *val, struct kernel_param *kp) set_debug(const char *val, const struct kernel_param *kp)
{ {
int ret; int ret;
struct sfax_hw *card; struct sfax_hw *card;

View file

@ -101,7 +101,7 @@ _set_debug(struct w6692_hw *card)
} }
static int static int
set_debug(const char *val, struct kernel_param *kp) set_debug(const char *val, const struct kernel_param *kp)
{ {
int ret; int ret;
struct w6692_hw *card; struct w6692_hw *card;

View file

@ -5095,7 +5095,7 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
return NULL; return NULL;
} }
static int add_named_array(const char *val, struct kernel_param *kp) static int add_named_array(const char *val, const struct kernel_param *kp)
{ {
/* val must be "md_*" where * is not all digits. /* val must be "md_*" where * is not all digits.
* We allocate an array with a large free minor number, and * We allocate an array with a large free minor number, and
@ -8965,11 +8965,11 @@ static __exit void md_exit(void)
subsys_initcall(md_init); subsys_initcall(md_init);
module_exit(md_exit) module_exit(md_exit)
static int get_ro(char *buffer, struct kernel_param *kp) static int get_ro(char *buffer, const struct kernel_param *kp)
{ {
return sprintf(buffer, "%d", start_readonly); return sprintf(buffer, "%d", start_readonly);
} }
static int set_ro(const char *val, struct kernel_param *kp) static int set_ro(const char *val, const struct kernel_param *kp)
{ {
return kstrtouint(val, 10, (unsigned int *)&start_readonly); return kstrtouint(val, 10, (unsigned int *)&start_readonly);
} }

View file

@ -72,12 +72,12 @@ static const char *dma_mode_name(unsigned int mode)
} }
} }
static int tw686x_dma_mode_get(char *buffer, struct kernel_param *kp) static int tw686x_dma_mode_get(char *buffer, const struct kernel_param *kp)
{ {
return sprintf(buffer, dma_mode_name(dma_mode)); return sprintf(buffer, dma_mode_name(dma_mode));
} }
static int tw686x_dma_mode_set(const char *val, struct kernel_param *kp) static int tw686x_dma_mode_set(const char *val, const struct kernel_param *kp)
{ {
if (!strcasecmp(val, dma_mode_name(TW686X_DMA_MODE_MEMCPY))) if (!strcasecmp(val, dma_mode_name(TW686X_DMA_MODE_MEMCPY)))
dma_mode = TW686X_DMA_MODE_MEMCPY; dma_mode = TW686X_DMA_MODE_MEMCPY;

View file

@ -2184,7 +2184,7 @@ static int uvc_reset_resume(struct usb_interface *intf)
* Module parameters * Module parameters
*/ */
static int uvc_clock_param_get(char *buffer, struct kernel_param *kp) static int uvc_clock_param_get(char *buffer, const struct kernel_param *kp)
{ {
if (uvc_clock_param == CLOCK_MONOTONIC) if (uvc_clock_param == CLOCK_MONOTONIC)
return sprintf(buffer, "CLOCK_MONOTONIC"); return sprintf(buffer, "CLOCK_MONOTONIC");
@ -2192,7 +2192,7 @@ static int uvc_clock_param_get(char *buffer, struct kernel_param *kp)
return sprintf(buffer, "CLOCK_REALTIME"); return sprintf(buffer, "CLOCK_REALTIME");
} }
static int uvc_clock_param_set(const char *val, struct kernel_param *kp) static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
{ {
if (strncasecmp(val, "clock_", strlen("clock_")) == 0) if (strncasecmp(val, "clock_", strlen("clock_")) == 0)
val += strlen("clock_"); val += strlen("clock_");

View file

@ -99,7 +99,7 @@ module_param(mpt_channel_mapping, int, 0);
MODULE_PARM_DESC(mpt_channel_mapping, " Mapping id's to channels (default=0)"); MODULE_PARM_DESC(mpt_channel_mapping, " Mapping id's to channels (default=0)");
static int mpt_debug_level; static int mpt_debug_level;
static int mpt_set_debug_level(const char *val, struct kernel_param *kp); static int mpt_set_debug_level(const char *val, const struct kernel_param *kp);
module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int, module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int,
&mpt_debug_level, 0600); &mpt_debug_level, 0600);
MODULE_PARM_DESC(mpt_debug_level, MODULE_PARM_DESC(mpt_debug_level,
@ -242,7 +242,7 @@ pci_enable_io_access(struct pci_dev *pdev)
pci_write_config_word(pdev, PCI_COMMAND, command_reg); pci_write_config_word(pdev, PCI_COMMAND, command_reg);
} }
static int mpt_set_debug_level(const char *val, struct kernel_param *kp) static int mpt_set_debug_level(const char *val, const struct kernel_param *kp)
{ {
int ret = param_set_int(val, kp); int ret = param_set_int(val, kp);
MPT_ADAPTER *ioc; MPT_ADAPTER *ioc;

View file

@ -1130,7 +1130,8 @@ static void kgdbts_put_char(u8 chr)
ts.run_test(0, chr); ts.run_test(0, chr);
} }
static int param_set_kgdbts_var(const char *kmessage, struct kernel_param *kp) static int param_set_kgdbts_var(const char *kmessage,
const struct kernel_param *kp)
{ {
int len = strlen(kmessage); int len = strlen(kmessage);

View file

@ -431,7 +431,7 @@ static int block2mtd_setup2(const char *val)
} }
static int block2mtd_setup(const char *val, struct kernel_param *kp) static int block2mtd_setup(const char *val, const struct kernel_param *kp)
{ {
#ifdef MODULE #ifdef MODULE
return block2mtd_setup2(val); return block2mtd_setup2(val);

View file

@ -266,7 +266,7 @@ static int phram_setup(const char *val)
return ret; return ret;
} }
static int phram_param_call(const char *val, struct kernel_param *kp) static int phram_param_call(const char *val, const struct kernel_param *kp)
{ {
#ifdef MODULE #ifdef MODULE
return phram_setup(val); return phram_setup(val);

View file

@ -1389,7 +1389,7 @@ static int __init bytes_str_to_int(const char *str)
* This function returns zero in case of success and a negative error code in * This function returns zero in case of success and a negative error code in
* case of error. * case of error.
*/ */
static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) static int __init ubi_mtd_param_parse(const char *val, const struct kernel_param *kp)
{ {
int i, len; int i, len;
struct mtd_dev_param *p; struct mtd_dev_param *p;

View file

@ -782,7 +782,8 @@ void pci_disable_link_state(struct pci_dev *pdev, int state)
} }
EXPORT_SYMBOL(pci_disable_link_state); EXPORT_SYMBOL(pci_disable_link_state);
static int pcie_aspm_set_policy(const char *val, struct kernel_param *kp) static int pcie_aspm_set_policy(const char *val,
const struct kernel_param *kp)
{ {
int i; int i;
struct pcie_link_state *link; struct pcie_link_state *link;
@ -809,7 +810,7 @@ static int pcie_aspm_set_policy(const char *val, struct kernel_param *kp)
return 0; return 0;
} }
static int pcie_aspm_get_policy(char *buffer, struct kernel_param *kp) static int pcie_aspm_get_policy(char *buffer, const struct kernel_param *kp)
{ {
int i, cnt = 0; int i, cnt = 0;
for (i = 0; i < ARRAY_SIZE(policy_str); i++) for (i = 0; i < ARRAY_SIZE(policy_str); i++)

View file

@ -9526,7 +9526,7 @@ static struct ibm_init_struct ibms_init[] __initdata = {
}, },
}; };
static int __init set_ibm_param(const char *val, struct kernel_param *kp) static int __init set_ibm_param(const char *val, const struct kernel_param *kp)
{ {
unsigned int i; unsigned int i;
struct ibm_struct *ibm; struct ibm_struct *ibm;

View file

@ -32,13 +32,13 @@ MODULE_AUTHOR("Open-FCoE.org");
MODULE_DESCRIPTION("FIP discovery protocol and FCoE transport for FCoE HBAs"); MODULE_DESCRIPTION("FIP discovery protocol and FCoE transport for FCoE HBAs");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
static int fcoe_transport_create(const char *, struct kernel_param *); static int fcoe_transport_create(const char *, const struct kernel_param *);
static int fcoe_transport_destroy(const char *, struct kernel_param *); static int fcoe_transport_destroy(const char *, const struct kernel_param *);
static int fcoe_transport_show(char *buffer, const struct kernel_param *kp); static int fcoe_transport_show(char *buffer, const struct kernel_param *kp);
static struct fcoe_transport *fcoe_transport_lookup(struct net_device *device); static struct fcoe_transport *fcoe_transport_lookup(struct net_device *device);
static struct fcoe_transport *fcoe_netdev_map_lookup(struct net_device *device); static struct fcoe_transport *fcoe_netdev_map_lookup(struct net_device *device);
static int fcoe_transport_enable(const char *, struct kernel_param *); static int fcoe_transport_enable(const char *, const struct kernel_param *);
static int fcoe_transport_disable(const char *, struct kernel_param *); static int fcoe_transport_disable(const char *, const struct kernel_param *);
static int libfcoe_device_notification(struct notifier_block *notifier, static int libfcoe_device_notification(struct notifier_block *notifier,
ulong event, void *ptr); ulong event, void *ptr);
@ -865,7 +865,8 @@ EXPORT_SYMBOL(fcoe_ctlr_destroy_store);
* *
* Returns: 0 for success * Returns: 0 for success
*/ */
static int fcoe_transport_create(const char *buffer, struct kernel_param *kp) static int fcoe_transport_create(const char *buffer,
const struct kernel_param *kp)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct net_device *netdev = NULL; struct net_device *netdev = NULL;
@ -930,7 +931,8 @@ out_nodev:
* *
* Returns: 0 for success * Returns: 0 for success
*/ */
static int fcoe_transport_destroy(const char *buffer, struct kernel_param *kp) static int fcoe_transport_destroy(const char *buffer,
const struct kernel_param *kp)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct net_device *netdev = NULL; struct net_device *netdev = NULL;
@ -974,7 +976,8 @@ out_nodev:
* *
* Returns: 0 for success * Returns: 0 for success
*/ */
static int fcoe_transport_disable(const char *buffer, struct kernel_param *kp) static int fcoe_transport_disable(const char *buffer,
const struct kernel_param *kp)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct net_device *netdev = NULL; struct net_device *netdev = NULL;
@ -1008,7 +1011,8 @@ out_nodev:
* *
* Returns: 0 for success * Returns: 0 for success
*/ */
static int fcoe_transport_enable(const char *buffer, struct kernel_param *kp) static int fcoe_transport_enable(const char *buffer,
const struct kernel_param *kp)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct net_device *netdev = NULL; struct net_device *netdev = NULL;

View file

@ -105,7 +105,7 @@ _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc);
* *
*/ */
static int static int
_scsih_set_fwfault_debug(const char *val, struct kernel_param *kp) _scsih_set_fwfault_debug(const char *val, const struct kernel_param *kp)
{ {
int ret = param_set_int(val, kp); int ret = param_set_int(val, kp);
struct MPT3SAS_ADAPTER *ioc; struct MPT3SAS_ADAPTER *ioc;

View file

@ -281,7 +281,7 @@ struct _scsi_io_transfer {
* Note: The logging levels are defined in mpt3sas_debug.h. * Note: The logging levels are defined in mpt3sas_debug.h.
*/ */
static int static int
_scsih_set_debug_level(const char *val, struct kernel_param *kp) _scsih_set_debug_level(const char *val, const struct kernel_param *kp)
{ {
int ret = param_set_int(val, kp); int ret = param_set_int(val, kp);
struct MPT3SAS_ADAPTER *ioc; struct MPT3SAS_ADAPTER *ioc;

View file

@ -245,7 +245,8 @@ static void kgdboc_put_char(u8 chr)
kgdb_tty_line, chr); kgdb_tty_line, chr);
} }
static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) static int param_set_kgdboc_var(const char *kmessage,
const struct kernel_param *kp)
{ {
int len = strlen(kmessage); int len = strlen(kmessage);

View file

@ -30,7 +30,7 @@ static struct kmem_cache *fuse_inode_cachep;
struct list_head fuse_conn_list; struct list_head fuse_conn_list;
DEFINE_MUTEX(fuse_mutex); DEFINE_MUTEX(fuse_mutex);
static int set_global_limit(const char *val, struct kernel_param *kp); static int set_global_limit(const char *val, const struct kernel_param *kp);
unsigned max_user_bgreq; unsigned max_user_bgreq;
module_param_call(max_user_bgreq, set_global_limit, param_get_uint, module_param_call(max_user_bgreq, set_global_limit, param_get_uint,
@ -827,7 +827,7 @@ static void sanitize_global_limit(unsigned *limit)
*limit = (1 << 16) - 1; *limit = (1 << 16) - 1;
} }
static int set_global_limit(const char *val, struct kernel_param *kp) static int set_global_limit(const char *val, const struct kernel_param *kp)
{ {
int rv; int rv;

View file

@ -596,7 +596,7 @@ static struct ctl_table nlm_sysctl_root[] = {
*/ */
#define param_set_min_max(name, type, which_strtol, min, max) \ #define param_set_min_max(name, type, which_strtol, min, max) \
static int param_set_##name(const char *val, struct kernel_param *kp) \ static int param_set_##name(const char *val, const struct kernel_param *kp) \
{ \ { \
char *endp; \ char *endp; \
__typeof__(type) num = which_strtol(val, &endp, 0); \ __typeof__(type) num = which_strtol(val, &endp, 0); \

View file

@ -88,13 +88,13 @@ struct workqueue_struct *user_dlm_worker;
*/ */
#define DLMFS_CAPABILITIES "bast stackglue" #define DLMFS_CAPABILITIES "bast stackglue"
static int param_set_dlmfs_capabilities(const char *val, static int param_set_dlmfs_capabilities(const char *val,
struct kernel_param *kp) const struct kernel_param *kp)
{ {
printk(KERN_ERR "%s: readonly parameter\n", kp->name); printk(KERN_ERR "%s: readonly parameter\n", kp->name);
return -EINVAL; return -EINVAL;
} }
static int param_get_dlmfs_capabilities(char *buffer, static int param_get_dlmfs_capabilities(char *buffer,
struct kernel_param *kp) const struct kernel_param *kp)
{ {
return strlcpy(buffer, DLMFS_CAPABILITIES, return strlcpy(buffer, DLMFS_CAPABILITIES,
strlen(DLMFS_CAPABILITIES) + 1); strlen(DLMFS_CAPABILITIES) + 1);

View file

@ -306,7 +306,7 @@ static inline bool nf_ct_should_gc(const struct nf_conn *ct)
struct kernel_param; struct kernel_param;
int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); int nf_conntrack_set_hashsize(const char *val, const struct kernel_param *kp);
int nf_conntrack_hash_resize(unsigned int hashsize); int nf_conntrack_hash_resize(unsigned int hashsize);
extern struct hlist_nulls_head *nf_conntrack_hash; extern struct hlist_nulls_head *nf_conntrack_hash;

View file

@ -1794,7 +1794,7 @@ int nf_conntrack_hash_resize(unsigned int hashsize)
return 0; return 0;
} }
int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp) int nf_conntrack_set_hashsize(const char *val, const struct kernel_param *kp)
{ {
unsigned int hashsize; unsigned int hashsize;
int rc; int rc;

View file

@ -134,7 +134,7 @@ static int __init nf_nat_ftp_init(void)
} }
/* Prior to 2.6.11, we had a ports param. No longer, but don't break users. */ /* Prior to 2.6.11, we had a ports param. No longer, but don't break users. */
static int warn_set(const char *val, struct kernel_param *kp) static int warn_set(const char *val, const struct kernel_param *kp)
{ {
printk(KERN_INFO KBUILD_MODNAME printk(KERN_INFO KBUILD_MODNAME
": kernel >= 2.6.10 only uses 'ports' for conntrack modules\n"); ": kernel >= 2.6.10 only uses 'ports' for conntrack modules\n");

View file

@ -107,7 +107,7 @@ static int __init nf_nat_irc_init(void)
} }
/* Prior to 2.6.11, we had a ports param. No longer, but don't break users. */ /* Prior to 2.6.11, we had a ports param. No longer, but don't break users. */
static int warn_set(const char *val, struct kernel_param *kp) static int warn_set(const char *val, const struct kernel_param *kp)
{ {
printk(KERN_INFO KBUILD_MODNAME printk(KERN_INFO KBUILD_MODNAME
": kernel >= 2.6.10 only uses 'ports' for conntrack modules\n"); ": kernel >= 2.6.10 only uses 'ports' for conntrack modules\n");

View file

@ -50,7 +50,7 @@ EXPORT_SYMBOL_GPL(svc_pool_map);
static DEFINE_MUTEX(svc_pool_map_mutex);/* protects svc_pool_map.count only */ static DEFINE_MUTEX(svc_pool_map_mutex);/* protects svc_pool_map.count only */
static int static int
param_set_pool_mode(const char *val, struct kernel_param *kp) param_set_pool_mode(const char *val, const struct kernel_param *kp)
{ {
int *ip = (int *)kp->arg; int *ip = (int *)kp->arg;
struct svc_pool_map *m = &svc_pool_map; struct svc_pool_map *m = &svc_pool_map;
@ -80,7 +80,7 @@ out:
} }
static int static int
param_get_pool_mode(char *buf, struct kernel_param *kp) param_get_pool_mode(char *buf, const struct kernel_param *kp)
{ {
int *ip = (int *)kp->arg; int *ip = (int *)kp->arg;

View file

@ -656,11 +656,11 @@ static const struct kernel_param_ops param_ops_aalockpolicy = {
.get = param_get_aalockpolicy .get = param_get_aalockpolicy
}; };
static int param_set_audit(const char *val, struct kernel_param *kp); static int param_set_audit(const char *val, const struct kernel_param *kp);
static int param_get_audit(char *buffer, struct kernel_param *kp); static int param_get_audit(char *buffer, const struct kernel_param *kp);
static int param_set_mode(const char *val, struct kernel_param *kp); static int param_set_mode(const char *val, const struct kernel_param *kp);
static int param_get_mode(char *buffer, struct kernel_param *kp); static int param_get_mode(char *buffer, const struct kernel_param *kp);
/* Flag values, also controllable via /sys/module/apparmor/parameters /* Flag values, also controllable via /sys/module/apparmor/parameters
* We define special types as we want to do additional mediation. * We define special types as we want to do additional mediation.
@ -774,7 +774,7 @@ static int param_get_aauint(char *buffer, const struct kernel_param *kp)
return param_get_uint(buffer, kp); return param_get_uint(buffer, kp);
} }
static int param_get_audit(char *buffer, struct kernel_param *kp) static int param_get_audit(char *buffer, const struct kernel_param *kp)
{ {
if (!policy_view_capable()) if (!policy_view_capable())
return -EPERM; return -EPERM;
@ -785,7 +785,7 @@ static int param_get_audit(char *buffer, struct kernel_param *kp)
return sprintf(buffer, "%s", audit_mode_names[aa_g_audit]); return sprintf(buffer, "%s", audit_mode_names[aa_g_audit]);
} }
static int param_set_audit(const char *val, struct kernel_param *kp) static int param_set_audit(const char *val, const struct kernel_param *kp)
{ {
int i; int i;
if (!policy_admin_capable()) if (!policy_admin_capable())
@ -807,7 +807,7 @@ static int param_set_audit(const char *val, struct kernel_param *kp)
return -EINVAL; return -EINVAL;
} }
static int param_get_mode(char *buffer, struct kernel_param *kp) static int param_get_mode(char *buffer, const struct kernel_param *kp)
{ {
if (!policy_admin_capable()) if (!policy_admin_capable())
return -EPERM; return -EPERM;
@ -818,7 +818,7 @@ static int param_get_mode(char *buffer, struct kernel_param *kp)
return sprintf(buffer, "%s", aa_profile_mode_names[aa_g_profile_mode]); return sprintf(buffer, "%s", aa_profile_mode_names[aa_g_profile_mode]);
} }
static int param_set_mode(const char *val, struct kernel_param *kp) static int param_set_mode(const char *val, const struct kernel_param *kp)
{ {
int i; int i;
if (!policy_admin_capable()) if (!policy_admin_capable())