diff options
author | Jiri Pirko <jiri@nvidia.com> | 2023-01-26 08:58:33 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-01-27 13:32:02 +0100 |
commit | 85fe0b324c830ac671b811efc70ea80c3dcb2390 (patch) | |
tree | 1d03a943a8e6136ddeffdfaa33a2be616558af70 /net/devlink/leftover.c | |
parent | qed: remove pointless call to devlink_param_driverinit_value_set() (diff) | |
download | linux-85fe0b324c830ac671b811efc70ea80c3dcb2390.tar.xz linux-85fe0b324c830ac671b811efc70ea80c3dcb2390.zip |
devlink: make devlink_param_driverinit_value_set() return void
devlink_param_driverinit_value_set() currently returns int with possible
error, but no user is checking it anyway. The only reason for a fail is
a driver bug. So convert the function to return void and put WARN_ONs
on error paths.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/devlink/leftover.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c index fca2b6661362..693470af548f 100644 --- a/net/devlink/leftover.c +++ b/net/devlink/leftover.c @@ -10931,18 +10931,18 @@ EXPORT_SYMBOL_GPL(devlink_param_driverinit_value_get); * This function should be used by the driver to set driverinit * configuration mode default value. */ -int devlink_param_driverinit_value_set(struct devlink *devlink, u32 param_id, - union devlink_param_value init_val) +void devlink_param_driverinit_value_set(struct devlink *devlink, u32 param_id, + union devlink_param_value init_val) { struct devlink_param_item *param_item; param_item = devlink_param_find_by_id(&devlink->param_list, param_id); - if (!param_item) - return -EINVAL; + if (WARN_ON(!param_item)) + return; - if (!devlink_param_cmode_is_supported(param_item->param, - DEVLINK_PARAM_CMODE_DRIVERINIT)) - return -EOPNOTSUPP; + if (WARN_ON(!devlink_param_cmode_is_supported(param_item->param, + DEVLINK_PARAM_CMODE_DRIVERINIT))) + return; if (param_item->param->type == DEVLINK_PARAM_TYPE_STRING) strcpy(param_item->driverinit_value.vstr, init_val.vstr); @@ -10951,7 +10951,6 @@ int devlink_param_driverinit_value_set(struct devlink *devlink, u32 param_id, param_item->driverinit_value_valid = true; devlink_param_notify(devlink, 0, param_item, DEVLINK_CMD_PARAM_NEW); - return 0; } EXPORT_SYMBOL_GPL(devlink_param_driverinit_value_set); |