diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-09-08 07:17:35 -0400 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2014-09-23 09:36:20 -0400 |
commit | 495daef902425e241a0b95791f3aeb737928256a (patch) | |
tree | b6a51af18f516b4e56d481ba0244a02ebf081bc3 /drivers/xen | |
parent | d9b1e6374b3a9b88774e30d0c6bf6e394cd10b76 (diff) |
xen-scsiback: clean up a type issue in scsiback_make_tpg()
This code was confusing because we had an unsigned long and then we
compared it to UINT_MAX and then we stored it in a u16. How many bytes
is this supposed to have: 2, 4 or 16???
I've made it a u16 throughout.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xen-scsiback.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 7b5656323739..ad11258a78d6 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c | |||
@@ -1885,13 +1885,14 @@ scsiback_make_tpg(struct se_wwn *wwn, | |||
1885 | struct scsiback_tport, tport_wwn); | 1885 | struct scsiback_tport, tport_wwn); |
1886 | 1886 | ||
1887 | struct scsiback_tpg *tpg; | 1887 | struct scsiback_tpg *tpg; |
1888 | unsigned long tpgt; | 1888 | u16 tpgt; |
1889 | int ret; | 1889 | int ret; |
1890 | 1890 | ||
1891 | if (strstr(name, "tpgt_") != name) | 1891 | if (strstr(name, "tpgt_") != name) |
1892 | return ERR_PTR(-EINVAL); | 1892 | return ERR_PTR(-EINVAL); |
1893 | if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX) | 1893 | ret = kstrtou16(name + 5, 10, &tpgt); |
1894 | return ERR_PTR(-EINVAL); | 1894 | if (ret) |
1895 | return ERR_PTR(ret); | ||
1895 | 1896 | ||
1896 | tpg = kzalloc(sizeof(struct scsiback_tpg), GFP_KERNEL); | 1897 | tpg = kzalloc(sizeof(struct scsiback_tpg), GFP_KERNEL); |
1897 | if (!tpg) | 1898 | if (!tpg) |