diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-07-19 03:22:19 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-08-12 23:31:44 -0400 |
commit | 57103d7fe1833857cf542a482c1eb8da0bf86e5d (patch) | |
tree | 75a7439ace0d34b69d2fb1f84c43f5454f673ac8 | |
parent | d4e4ab86bcba5a72779c43dc1459f71fea3d89c8 (diff) |
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>
-rw-r--r-- | drivers/target/iscsi/iscsi_target_configfs.c | 8 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_login.c | 2 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_parameters.c | 2 | ||||
-rw-r--r-- | drivers/target/target_core_alua.c | 32 | ||||
-rw-r--r-- | drivers/target/target_core_configfs.c | 42 | ||||
-rw-r--r-- | drivers/target/target_core_fabric_configfs.c | 16 | ||||
-rw-r--r-- | drivers/target/target_core_file.c | 4 | ||||
-rw-r--r-- | drivers/target/target_core_iblock.c | 4 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_conf.c | 6 |
9 files changed, 64 insertions, 52 deletions
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index bbfd28893164..ddfa32c3f564 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
@@ -265,9 +265,9 @@ static struct se_tpg_np *lio_target_call_addnptotpg( | |||
265 | *port_str = '\0'; /* Terminate string for IP */ | 265 | *port_str = '\0'; /* Terminate string for IP */ |
266 | port_str++; /* Skip over ":" */ | 266 | port_str++; /* Skip over ":" */ |
267 | 267 | ||
268 | ret = strict_strtoul(port_str, 0, &port); | 268 | ret = kstrtoul(port_str, 0, &port); |
269 | if (ret < 0) { | 269 | if (ret < 0) { |
270 | pr_err("strict_strtoul() failed for port_str: %d\n", ret); | 270 | pr_err("kstrtoul() failed for port_str: %d\n", ret); |
271 | return ERR_PTR(ret); | 271 | return ERR_PTR(ret); |
272 | } | 272 | } |
273 | sock_in6 = (struct sockaddr_in6 *)&sockaddr; | 273 | sock_in6 = (struct sockaddr_in6 *)&sockaddr; |
@@ -290,9 +290,9 @@ static struct se_tpg_np *lio_target_call_addnptotpg( | |||
290 | *port_str = '\0'; /* Terminate string for IP */ | 290 | *port_str = '\0'; /* Terminate string for IP */ |
291 | port_str++; /* Skip over ":" */ | 291 | port_str++; /* Skip over ":" */ |
292 | 292 | ||
293 | ret = strict_strtoul(port_str, 0, &port); | 293 | ret = kstrtoul(port_str, 0, &port); |
294 | if (ret < 0) { | 294 | if (ret < 0) { |
295 | pr_err("strict_strtoul() failed for port_str: %d\n", ret); | 295 | pr_err("kstrtoul() failed for port_str: %d\n", ret); |
296 | return ERR_PTR(ret); | 296 | return ERR_PTR(ret); |
297 | } | 297 | } |
298 | sock_in = (struct sockaddr_in *)&sockaddr; | 298 | sock_in = (struct sockaddr_in *)&sockaddr; |
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 3402241be87c..76cf1cd62e29 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c | |||
@@ -428,7 +428,7 @@ static int iscsi_login_zero_tsih_s2( | |||
428 | ISCSI_LOGIN_STATUS_NO_RESOURCES); | 428 | ISCSI_LOGIN_STATUS_NO_RESOURCES); |
429 | return -1; | 429 | return -1; |
430 | } | 430 | } |
431 | rc = strict_strtoul(param->value, 0, &mrdsl); | 431 | rc = kstrtoul(param->value, 0, &mrdsl); |
432 | if (rc < 0) { | 432 | if (rc < 0) { |
433 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, | 433 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, |
434 | ISCSI_LOGIN_STATUS_NO_RESOURCES); | 434 | ISCSI_LOGIN_STATUS_NO_RESOURCES); |
diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index 35fd6439eb01..034bd6daaaec 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c | |||
@@ -1182,7 +1182,7 @@ static int iscsi_check_acceptor_state(struct iscsi_param *param, char *value, | |||
1182 | unsigned long long tmp; | 1182 | unsigned long long tmp; |
1183 | int rc; | 1183 | int rc; |
1184 | 1184 | ||
1185 | rc = strict_strtoull(param->value, 0, &tmp); | 1185 | rc = kstrtoull(param->value, 0, &tmp); |
1186 | if (rc < 0) | 1186 | if (rc < 0) |
1187 | return -1; | 1187 | return -1; |
1188 | 1188 | ||
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index cbe48ab41745..5403186e4777 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c | |||
@@ -1756,10 +1756,10 @@ ssize_t core_alua_store_access_type( | |||
1756 | unsigned long tmp; | 1756 | unsigned long tmp; |
1757 | int ret; | 1757 | int ret; |
1758 | 1758 | ||
1759 | ret = strict_strtoul(page, 0, &tmp); | 1759 | ret = kstrtoul(page, 0, &tmp); |
1760 | if (ret < 0) { | 1760 | if (ret < 0) { |
1761 | pr_err("Unable to extract alua_access_type\n"); | 1761 | pr_err("Unable to extract alua_access_type\n"); |
1762 | return -EINVAL; | 1762 | return ret; |
1763 | } | 1763 | } |
1764 | if ((tmp != 0) && (tmp != 1) && (tmp != 2) && (tmp != 3)) { | 1764 | if ((tmp != 0) && (tmp != 1) && (tmp != 2) && (tmp != 3)) { |
1765 | pr_err("Illegal value for alua_access_type:" | 1765 | pr_err("Illegal value for alua_access_type:" |
@@ -1794,10 +1794,10 @@ ssize_t core_alua_store_nonop_delay_msecs( | |||
1794 | unsigned long tmp; | 1794 | unsigned long tmp; |
1795 | int ret; | 1795 | int ret; |
1796 | 1796 | ||
1797 | ret = strict_strtoul(page, 0, &tmp); | 1797 | ret = kstrtoul(page, 0, &tmp); |
1798 | if (ret < 0) { | 1798 | if (ret < 0) { |
1799 | pr_err("Unable to extract nonop_delay_msecs\n"); | 1799 | pr_err("Unable to extract nonop_delay_msecs\n"); |
1800 | return -EINVAL; | 1800 | return ret; |
1801 | } | 1801 | } |
1802 | if (tmp > ALUA_MAX_NONOP_DELAY_MSECS) { | 1802 | if (tmp > ALUA_MAX_NONOP_DELAY_MSECS) { |
1803 | pr_err("Passed nonop_delay_msecs: %lu, exceeds" | 1803 | pr_err("Passed nonop_delay_msecs: %lu, exceeds" |
@@ -1825,10 +1825,10 @@ ssize_t core_alua_store_trans_delay_msecs( | |||
1825 | unsigned long tmp; | 1825 | unsigned long tmp; |
1826 | int ret; | 1826 | int ret; |
1827 | 1827 | ||
1828 | ret = strict_strtoul(page, 0, &tmp); | 1828 | ret = kstrtoul(page, 0, &tmp); |
1829 | if (ret < 0) { | 1829 | if (ret < 0) { |
1830 | pr_err("Unable to extract trans_delay_msecs\n"); | 1830 | pr_err("Unable to extract trans_delay_msecs\n"); |
1831 | return -EINVAL; | 1831 | return ret; |
1832 | } | 1832 | } |
1833 | if (tmp > ALUA_MAX_TRANS_DELAY_MSECS) { | 1833 | if (tmp > ALUA_MAX_TRANS_DELAY_MSECS) { |
1834 | pr_err("Passed trans_delay_msecs: %lu, exceeds" | 1834 | pr_err("Passed trans_delay_msecs: %lu, exceeds" |
@@ -1856,10 +1856,10 @@ ssize_t core_alua_store_implict_trans_secs( | |||
1856 | unsigned long tmp; | 1856 | unsigned long tmp; |
1857 | int ret; | 1857 | int ret; |
1858 | 1858 | ||
1859 | ret = strict_strtoul(page, 0, &tmp); | 1859 | ret = kstrtoul(page, 0, &tmp); |
1860 | if (ret < 0) { | 1860 | if (ret < 0) { |
1861 | pr_err("Unable to extract implict_trans_secs\n"); | 1861 | pr_err("Unable to extract implict_trans_secs\n"); |
1862 | return -EINVAL; | 1862 | return ret; |
1863 | } | 1863 | } |
1864 | if (tmp > ALUA_MAX_IMPLICT_TRANS_SECS) { | 1864 | if (tmp > ALUA_MAX_IMPLICT_TRANS_SECS) { |
1865 | pr_err("Passed implict_trans_secs: %lu, exceeds" | 1865 | pr_err("Passed implict_trans_secs: %lu, exceeds" |
@@ -1887,10 +1887,10 @@ ssize_t core_alua_store_preferred_bit( | |||
1887 | unsigned long tmp; | 1887 | unsigned long tmp; |
1888 | int ret; | 1888 | int ret; |
1889 | 1889 | ||
1890 | ret = strict_strtoul(page, 0, &tmp); | 1890 | ret = kstrtoul(page, 0, &tmp); |
1891 | if (ret < 0) { | 1891 | if (ret < 0) { |
1892 | pr_err("Unable to extract preferred ALUA value\n"); | 1892 | pr_err("Unable to extract preferred ALUA value\n"); |
1893 | return -EINVAL; | 1893 | return ret; |
1894 | } | 1894 | } |
1895 | if ((tmp != 0) && (tmp != 1)) { | 1895 | if ((tmp != 0) && (tmp != 1)) { |
1896 | pr_err("Illegal value for preferred ALUA: %lu\n", tmp); | 1896 | pr_err("Illegal value for preferred ALUA: %lu\n", tmp); |
@@ -1922,10 +1922,10 @@ ssize_t core_alua_store_offline_bit( | |||
1922 | if (!lun->lun_sep) | 1922 | if (!lun->lun_sep) |
1923 | return -ENODEV; | 1923 | return -ENODEV; |
1924 | 1924 | ||
1925 | ret = strict_strtoul(page, 0, &tmp); | 1925 | ret = kstrtoul(page, 0, &tmp); |
1926 | if (ret < 0) { | 1926 | if (ret < 0) { |
1927 | pr_err("Unable to extract alua_tg_pt_offline value\n"); | 1927 | pr_err("Unable to extract alua_tg_pt_offline value\n"); |
1928 | return -EINVAL; | 1928 | return ret; |
1929 | } | 1929 | } |
1930 | if ((tmp != 0) && (tmp != 1)) { | 1930 | if ((tmp != 0) && (tmp != 1)) { |
1931 | pr_err("Illegal value for alua_tg_pt_offline: %lu\n", | 1931 | pr_err("Illegal value for alua_tg_pt_offline: %lu\n", |
@@ -1961,10 +1961,10 @@ ssize_t core_alua_store_secondary_status( | |||
1961 | unsigned long tmp; | 1961 | unsigned long tmp; |
1962 | int ret; | 1962 | int ret; |
1963 | 1963 | ||
1964 | ret = strict_strtoul(page, 0, &tmp); | 1964 | ret = kstrtoul(page, 0, &tmp); |
1965 | if (ret < 0) { | 1965 | if (ret < 0) { |
1966 | pr_err("Unable to extract alua_tg_pt_status\n"); | 1966 | pr_err("Unable to extract alua_tg_pt_status\n"); |
1967 | return -EINVAL; | 1967 | return ret; |
1968 | } | 1968 | } |
1969 | if ((tmp != ALUA_STATUS_NONE) && | 1969 | if ((tmp != ALUA_STATUS_NONE) && |
1970 | (tmp != ALUA_STATUS_ALTERED_BY_EXPLICT_STPG) && | 1970 | (tmp != ALUA_STATUS_ALTERED_BY_EXPLICT_STPG) && |
@@ -1994,10 +1994,10 @@ ssize_t core_alua_store_secondary_write_metadata( | |||
1994 | unsigned long tmp; | 1994 | unsigned long tmp; |
1995 | int ret; | 1995 | int ret; |
1996 | 1996 | ||
1997 | ret = strict_strtoul(page, 0, &tmp); | 1997 | ret = kstrtoul(page, 0, &tmp); |
1998 | if (ret < 0) { | 1998 | if (ret < 0) { |
1999 | pr_err("Unable to extract alua_tg_pt_write_md\n"); | 1999 | pr_err("Unable to extract alua_tg_pt_write_md\n"); |
2000 | return -EINVAL; | 2000 | return ret; |
2001 | } | 2001 | } |
2002 | if ((tmp != 0) && (tmp != 1)) { | 2002 | if ((tmp != 0) && (tmp != 1)) { |
2003 | pr_err("Illegal value for alua_tg_pt_write_md:" | 2003 | pr_err("Illegal value for alua_tg_pt_write_md:" |
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index e4d22933efaf..f67a9afdeb21 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
@@ -577,9 +577,9 @@ static ssize_t target_core_dev_store_attr_##_name( \ | |||
577 | unsigned long val; \ | 577 | unsigned long val; \ |
578 | int ret; \ | 578 | int ret; \ |
579 | \ | 579 | \ |
580 | ret = strict_strtoul(page, 0, &val); \ | 580 | ret = kstrtoul(page, 0, &val); \ |
581 | if (ret < 0) { \ | 581 | if (ret < 0) { \ |
582 | pr_err("strict_strtoul() failed with" \ | 582 | pr_err("kstrtoul() failed with" \ |
583 | " ret: %d\n", ret); \ | 583 | " ret: %d\n", ret); \ |
584 | return -EINVAL; \ | 584 | return -EINVAL; \ |
585 | } \ | 585 | } \ |
@@ -1310,9 +1310,9 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata( | |||
1310 | ret = -ENOMEM; | 1310 | ret = -ENOMEM; |
1311 | goto out; | 1311 | goto out; |
1312 | } | 1312 | } |
1313 | ret = strict_strtoull(arg_p, 0, &tmp_ll); | 1313 | ret = kstrtoull(arg_p, 0, &tmp_ll); |
1314 | if (ret < 0) { | 1314 | if (ret < 0) { |
1315 | pr_err("strict_strtoull() failed for" | 1315 | pr_err("kstrtoull() failed for" |
1316 | " sa_res_key=\n"); | 1316 | " sa_res_key=\n"); |
1317 | goto out; | 1317 | goto out; |
1318 | } | 1318 | } |
@@ -1836,11 +1836,11 @@ static ssize_t target_core_alua_lu_gp_store_attr_lu_gp_id( | |||
1836 | unsigned long lu_gp_id; | 1836 | unsigned long lu_gp_id; |
1837 | int ret; | 1837 | int ret; |
1838 | 1838 | ||
1839 | ret = strict_strtoul(page, 0, &lu_gp_id); | 1839 | ret = kstrtoul(page, 0, &lu_gp_id); |
1840 | if (ret < 0) { | 1840 | if (ret < 0) { |
1841 | pr_err("strict_strtoul() returned %d for" | 1841 | pr_err("kstrtoul() returned %d for" |
1842 | " lu_gp_id\n", ret); | 1842 | " lu_gp_id\n", ret); |
1843 | return -EINVAL; | 1843 | return ret; |
1844 | } | 1844 | } |
1845 | if (lu_gp_id > 0x0000ffff) { | 1845 | if (lu_gp_id > 0x0000ffff) { |
1846 | pr_err("ALUA lu_gp_id: %lu exceeds maximum:" | 1846 | 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( | |||
2032 | return -EINVAL; | 2032 | return -EINVAL; |
2033 | } | 2033 | } |
2034 | 2034 | ||
2035 | ret = strict_strtoul(page, 0, &tmp); | 2035 | ret = kstrtoul(page, 0, &tmp); |
2036 | if (ret < 0) { | 2036 | if (ret < 0) { |
2037 | pr_err("Unable to extract new ALUA access state from" | 2037 | pr_err("Unable to extract new ALUA access state from" |
2038 | " %s\n", page); | 2038 | " %s\n", page); |
2039 | return -EINVAL; | 2039 | return ret; |
2040 | } | 2040 | } |
2041 | new_state = (int)tmp; | 2041 | new_state = (int)tmp; |
2042 | 2042 | ||
@@ -2079,11 +2079,11 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_status( | |||
2079 | return -EINVAL; | 2079 | return -EINVAL; |
2080 | } | 2080 | } |
2081 | 2081 | ||
2082 | ret = strict_strtoul(page, 0, &tmp); | 2082 | ret = kstrtoul(page, 0, &tmp); |
2083 | if (ret < 0) { | 2083 | if (ret < 0) { |
2084 | pr_err("Unable to extract new ALUA access status" | 2084 | pr_err("Unable to extract new ALUA access status" |
2085 | " from %s\n", page); | 2085 | " from %s\n", page); |
2086 | return -EINVAL; | 2086 | return ret; |
2087 | } | 2087 | } |
2088 | new_status = (int)tmp; | 2088 | new_status = (int)tmp; |
2089 | 2089 | ||
@@ -2139,10 +2139,10 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_write_metadata( | |||
2139 | unsigned long tmp; | 2139 | unsigned long tmp; |
2140 | int ret; | 2140 | int ret; |
2141 | 2141 | ||
2142 | ret = strict_strtoul(page, 0, &tmp); | 2142 | ret = kstrtoul(page, 0, &tmp); |
2143 | if (ret < 0) { | 2143 | if (ret < 0) { |
2144 | pr_err("Unable to extract alua_write_metadata\n"); | 2144 | pr_err("Unable to extract alua_write_metadata\n"); |
2145 | return -EINVAL; | 2145 | return ret; |
2146 | } | 2146 | } |
2147 | 2147 | ||
2148 | if ((tmp != 0) && (tmp != 1)) { | 2148 | if ((tmp != 0) && (tmp != 1)) { |
@@ -2263,11 +2263,11 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_tg_pt_gp_id( | |||
2263 | unsigned long tg_pt_gp_id; | 2263 | unsigned long tg_pt_gp_id; |
2264 | int ret; | 2264 | int ret; |
2265 | 2265 | ||
2266 | ret = strict_strtoul(page, 0, &tg_pt_gp_id); | 2266 | ret = kstrtoul(page, 0, &tg_pt_gp_id); |
2267 | if (ret < 0) { | 2267 | if (ret < 0) { |
2268 | pr_err("strict_strtoul() returned %d for" | 2268 | pr_err("kstrtoul() returned %d for" |
2269 | " tg_pt_gp_id\n", ret); | 2269 | " tg_pt_gp_id\n", ret); |
2270 | return -EINVAL; | 2270 | return ret; |
2271 | } | 2271 | } |
2272 | if (tg_pt_gp_id > 0x0000ffff) { | 2272 | if (tg_pt_gp_id > 0x0000ffff) { |
2273 | pr_err("ALUA tg_pt_gp_id: %lu exceeds maximum:" | 2273 | 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, | |||
2676 | if (transport->pmode_enable_hba == NULL) | 2676 | if (transport->pmode_enable_hba == NULL) |
2677 | return -EINVAL; | 2677 | return -EINVAL; |
2678 | 2678 | ||
2679 | ret = strict_strtoul(page, 0, &mode_flag); | 2679 | ret = kstrtoul(page, 0, &mode_flag); |
2680 | if (ret < 0) { | 2680 | if (ret < 0) { |
2681 | pr_err("Unable to extract hba mode flag: %d\n", ret); | 2681 | pr_err("Unable to extract hba mode flag: %d\n", ret); |
2682 | return -EINVAL; | 2682 | return ret; |
2683 | } | 2683 | } |
2684 | 2684 | ||
2685 | if (hba->dev_count) { | 2685 | if (hba->dev_count) { |
@@ -2767,11 +2767,11 @@ static struct config_group *target_core_call_addhbatotarget( | |||
2767 | str++; /* Skip to start of plugin dependent ID */ | 2767 | str++; /* Skip to start of plugin dependent ID */ |
2768 | } | 2768 | } |
2769 | 2769 | ||
2770 | ret = strict_strtoul(str, 0, &plugin_dep_id); | 2770 | ret = kstrtoul(str, 0, &plugin_dep_id); |
2771 | if (ret < 0) { | 2771 | if (ret < 0) { |
2772 | pr_err("strict_strtoul() returned %d for" | 2772 | pr_err("kstrtoul() returned %d for" |
2773 | " plugin_dep_id\n", ret); | 2773 | " plugin_dep_id\n", ret); |
2774 | return ERR_PTR(-EINVAL); | 2774 | return ERR_PTR(ret); |
2775 | } | 2775 | } |
2776 | /* | 2776 | /* |
2777 | * Load up TCM subsystem plugins if they have not already been loaded. | 2777 | * Load up TCM subsystem plugins if they have not already been loaded. |
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index eb56eb129563..f5ce68f30ea2 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c | |||
@@ -189,9 +189,11 @@ static ssize_t target_fabric_mappedlun_store_write_protect( | |||
189 | struct se_node_acl *se_nacl = lacl->se_lun_nacl; | 189 | struct se_node_acl *se_nacl = lacl->se_lun_nacl; |
190 | struct se_portal_group *se_tpg = se_nacl->se_tpg; | 190 | struct se_portal_group *se_tpg = se_nacl->se_tpg; |
191 | unsigned long op; | 191 | unsigned long op; |
192 | int ret; | ||
192 | 193 | ||
193 | if (strict_strtoul(page, 0, &op)) | 194 | ret = kstrtoul(page, 0, &op); |
194 | return -EINVAL; | 195 | if (ret) |
196 | return ret; | ||
195 | 197 | ||
196 | if ((op != 1) && (op != 0)) | 198 | if ((op != 1) && (op != 0)) |
197 | return -EINVAL; | 199 | return -EINVAL; |
@@ -350,7 +352,10 @@ static struct config_group *target_fabric_make_mappedlun( | |||
350 | * Determine the Mapped LUN value. This is what the SCSI Initiator | 352 | * Determine the Mapped LUN value. This is what the SCSI Initiator |
351 | * Port will actually see. | 353 | * Port will actually see. |
352 | */ | 354 | */ |
353 | if (strict_strtoul(buf + 4, 0, &mapped_lun) || mapped_lun > UINT_MAX) { | 355 | ret = kstrtoul(buf + 4, 0, &mapped_lun); |
356 | if (ret) | ||
357 | goto out; | ||
358 | if (mapped_lun > UINT_MAX) { | ||
354 | ret = -EINVAL; | 359 | ret = -EINVAL; |
355 | goto out; | 360 | goto out; |
356 | } | 361 | } |
@@ -875,7 +880,10 @@ static struct config_group *target_fabric_make_lun( | |||
875 | " \"lun_$LUN_NUMBER\"\n"); | 880 | " \"lun_$LUN_NUMBER\"\n"); |
876 | return ERR_PTR(-EINVAL); | 881 | return ERR_PTR(-EINVAL); |
877 | } | 882 | } |
878 | if (strict_strtoul(name + 4, 0, &unpacked_lun) || unpacked_lun > UINT_MAX) | 883 | errno = kstrtoul(name + 4, 0, &unpacked_lun); |
884 | if (errno) | ||
885 | return ERR_PTR(errno); | ||
886 | if (unpacked_lun > UINT_MAX) | ||
879 | return ERR_PTR(-EINVAL); | 887 | return ERR_PTR(-EINVAL); |
880 | 888 | ||
881 | lun = core_get_lun_from_tpg(se_tpg, unpacked_lun); | 889 | lun = core_get_lun_from_tpg(se_tpg, unpacked_lun); |
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index b11890d85120..bc3245dfcdf7 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c | |||
@@ -635,10 +635,10 @@ static ssize_t fd_set_configfs_dev_params(struct se_device *dev, | |||
635 | ret = -ENOMEM; | 635 | ret = -ENOMEM; |
636 | break; | 636 | break; |
637 | } | 637 | } |
638 | ret = strict_strtoull(arg_p, 0, &fd_dev->fd_dev_size); | 638 | ret = kstrtoull(arg_p, 0, &fd_dev->fd_dev_size); |
639 | kfree(arg_p); | 639 | kfree(arg_p); |
640 | if (ret < 0) { | 640 | if (ret < 0) { |
641 | pr_err("strict_strtoull() failed for" | 641 | pr_err("kstrtoull() failed for" |
642 | " fd_dev_size=\n"); | 642 | " fd_dev_size=\n"); |
643 | goto out; | 643 | goto out; |
644 | } | 644 | } |
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index aa1620abec6d..0a460f3350eb 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c | |||
@@ -536,10 +536,10 @@ static ssize_t iblock_set_configfs_dev_params(struct se_device *dev, | |||
536 | ret = -ENOMEM; | 536 | ret = -ENOMEM; |
537 | break; | 537 | break; |
538 | } | 538 | } |
539 | ret = strict_strtoul(arg_p, 0, &tmp_readonly); | 539 | ret = kstrtoul(arg_p, 0, &tmp_readonly); |
540 | kfree(arg_p); | 540 | kfree(arg_p); |
541 | if (ret < 0) { | 541 | if (ret < 0) { |
542 | pr_err("strict_strtoul() failed for" | 542 | pr_err("kstrtoul() failed for" |
543 | " readonly=\n"); | 543 | " readonly=\n"); |
544 | goto out; | 544 | goto out; |
545 | } | 545 | } |
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c index b74feb0d5133..4e0050840a72 100644 --- a/drivers/target/tcm_fc/tfc_conf.c +++ b/drivers/target/tcm_fc/tfc_conf.c | |||
@@ -311,7 +311,11 @@ static struct se_portal_group *ft_add_tpg( | |||
311 | */ | 311 | */ |
312 | if (strstr(name, "tpgt_") != name) | 312 | if (strstr(name, "tpgt_") != name) |
313 | return NULL; | 313 | return NULL; |
314 | if (strict_strtoul(name + 5, 10, &index) || index > UINT_MAX) | 314 | |
315 | ret = kstrtoul(name + 5, 10, &index); | ||
316 | if (ret) | ||
317 | return NULL; | ||
318 | if (index > UINT_MAX) | ||
315 | return NULL; | 319 | return NULL; |
316 | 320 | ||
317 | lacl = container_of(wwn, struct ft_lport_acl, fc_lport_wwn); | 321 | lacl = container_of(wwn, struct ft_lport_acl, fc_lport_wwn); |