You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
target: replace strict_strto*() with kstrto*()
The usage of strict_strtoul() and strict_strtoull() is not preferred, because strict_strtoul() and strict_strtoull() are obsolete. Thus, kstrtoul() and kstrtoull() should be used. v2: Fix incorrect return in ft_add_tpg (Fengguang) Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
committed by
Nicholas Bellinger
parent
d4e4ab86bc
commit
57103d7fe1
@@ -577,9 +577,9 @@ static ssize_t target_core_dev_store_attr_##_name( \
|
||||
unsigned long val; \
|
||||
int ret; \
|
||||
\
|
||||
ret = strict_strtoul(page, 0, &val); \
|
||||
ret = kstrtoul(page, 0, &val); \
|
||||
if (ret < 0) { \
|
||||
pr_err("strict_strtoul() failed with" \
|
||||
pr_err("kstrtoul() failed with" \
|
||||
" ret: %d\n", ret); \
|
||||
return -EINVAL; \
|
||||
} \
|
||||
@@ -1310,9 +1310,9 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
ret = strict_strtoull(arg_p, 0, &tmp_ll);
|
||||
ret = kstrtoull(arg_p, 0, &tmp_ll);
|
||||
if (ret < 0) {
|
||||
pr_err("strict_strtoull() failed for"
|
||||
pr_err("kstrtoull() failed for"
|
||||
" sa_res_key=\n");
|
||||
goto out;
|
||||
}
|
||||
@@ -1836,11 +1836,11 @@ static ssize_t target_core_alua_lu_gp_store_attr_lu_gp_id(
|
||||
unsigned long lu_gp_id;
|
||||
int ret;
|
||||
|
||||
ret = strict_strtoul(page, 0, &lu_gp_id);
|
||||
ret = kstrtoul(page, 0, &lu_gp_id);
|
||||
if (ret < 0) {
|
||||
pr_err("strict_strtoul() returned %d for"
|
||||
pr_err("kstrtoul() returned %d for"
|
||||
" lu_gp_id\n", ret);
|
||||
return -EINVAL;
|
||||
return ret;
|
||||
}
|
||||
if (lu_gp_id > 0x0000ffff) {
|
||||
pr_err("ALUA lu_gp_id: %lu exceeds maximum:"
|
||||
@@ -2032,11 +2032,11 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_state(
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = strict_strtoul(page, 0, &tmp);
|
||||
ret = kstrtoul(page, 0, &tmp);
|
||||
if (ret < 0) {
|
||||
pr_err("Unable to extract new ALUA access state from"
|
||||
" %s\n", page);
|
||||
return -EINVAL;
|
||||
return ret;
|
||||
}
|
||||
new_state = (int)tmp;
|
||||
|
||||
@@ -2079,11 +2079,11 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_status(
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = strict_strtoul(page, 0, &tmp);
|
||||
ret = kstrtoul(page, 0, &tmp);
|
||||
if (ret < 0) {
|
||||
pr_err("Unable to extract new ALUA access status"
|
||||
" from %s\n", page);
|
||||
return -EINVAL;
|
||||
return ret;
|
||||
}
|
||||
new_status = (int)tmp;
|
||||
|
||||
@@ -2139,10 +2139,10 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_write_metadata(
|
||||
unsigned long tmp;
|
||||
int ret;
|
||||
|
||||
ret = strict_strtoul(page, 0, &tmp);
|
||||
ret = kstrtoul(page, 0, &tmp);
|
||||
if (ret < 0) {
|
||||
pr_err("Unable to extract alua_write_metadata\n");
|
||||
return -EINVAL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((tmp != 0) && (tmp != 1)) {
|
||||
@@ -2263,11 +2263,11 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_tg_pt_gp_id(
|
||||
unsigned long tg_pt_gp_id;
|
||||
int ret;
|
||||
|
||||
ret = strict_strtoul(page, 0, &tg_pt_gp_id);
|
||||
ret = kstrtoul(page, 0, &tg_pt_gp_id);
|
||||
if (ret < 0) {
|
||||
pr_err("strict_strtoul() returned %d for"
|
||||
pr_err("kstrtoul() returned %d for"
|
||||
" tg_pt_gp_id\n", ret);
|
||||
return -EINVAL;
|
||||
return ret;
|
||||
}
|
||||
if (tg_pt_gp_id > 0x0000ffff) {
|
||||
pr_err("ALUA tg_pt_gp_id: %lu exceeds maximum:"
|
||||
@@ -2676,10 +2676,10 @@ static ssize_t target_core_hba_store_attr_hba_mode(struct se_hba *hba,
|
||||
if (transport->pmode_enable_hba == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
ret = strict_strtoul(page, 0, &mode_flag);
|
||||
ret = kstrtoul(page, 0, &mode_flag);
|
||||
if (ret < 0) {
|
||||
pr_err("Unable to extract hba mode flag: %d\n", ret);
|
||||
return -EINVAL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (hba->dev_count) {
|
||||
@@ -2767,11 +2767,11 @@ static struct config_group *target_core_call_addhbatotarget(
|
||||
str++; /* Skip to start of plugin dependent ID */
|
||||
}
|
||||
|
||||
ret = strict_strtoul(str, 0, &plugin_dep_id);
|
||||
ret = kstrtoul(str, 0, &plugin_dep_id);
|
||||
if (ret < 0) {
|
||||
pr_err("strict_strtoul() returned %d for"
|
||||
pr_err("kstrtoul() returned %d for"
|
||||
" plugin_dep_id\n", ret);
|
||||
return ERR_PTR(-EINVAL);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
/*
|
||||
* Load up TCM subsystem plugins if they have not already been loaded.
|
||||
|
||||
Reference in New Issue
Block a user