aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2013-10-25 11:17:59 -0400
committerRoland Dreier <roland@purestorage.com>2013-11-08 17:43:12 -0500
commit2fadd83184d58701f1116ca578465b5a75f9417c (patch)
tree676b4e153134c38a6478fd2dc383e2baabf205fa /drivers/infiniband/hw
parent78a5886472085a6e458824858a8c8338113aec4e (diff)
IB/qib: Fix txselect regression
Commit 7fac33014f54("IB/qib: checkpatch fixes") was overzealous in removing a simple_strtoul for a parse routine, setup_txselect(). That routine is required to handle a multi-value string. Unwind that aspect of the fix. Cc: <stable@vger.kernel.org> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/qib/qib_iba7322.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
index 016e7429adf6..5bfc02f450e6 100644
--- a/drivers/infiniband/hw/qib/qib_iba7322.c
+++ b/drivers/infiniband/hw/qib/qib_iba7322.c
@@ -6190,21 +6190,20 @@ static int setup_txselect(const char *str, struct kernel_param *kp)
6190{ 6190{
6191 struct qib_devdata *dd; 6191 struct qib_devdata *dd;
6192 unsigned long val; 6192 unsigned long val;
6193 int ret; 6193 char *n;
6194
6195 if (strlen(str) >= MAX_ATTEN_LEN) { 6194 if (strlen(str) >= MAX_ATTEN_LEN) {
6196 pr_info("txselect_values string too long\n"); 6195 pr_info("txselect_values string too long\n");
6197 return -ENOSPC; 6196 return -ENOSPC;
6198 } 6197 }
6199 ret = kstrtoul(str, 0, &val); 6198 val = simple_strtoul(str, &n, 0);
6200 if (ret || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + 6199 if (n == str || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ +
6201 TXDDS_MFG_SZ)) { 6200 TXDDS_MFG_SZ)) {
6202 pr_info("txselect_values must start with a number < %d\n", 6201 pr_info("txselect_values must start with a number < %d\n",
6203 TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ); 6202 TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ);
6204 return ret ? ret : -EINVAL; 6203 return -EINVAL;
6205 } 6204 }
6206
6207 strcpy(txselect_list, str); 6205 strcpy(txselect_list, str);
6206
6208 list_for_each_entry(dd, &qib_dev_list, list) 6207 list_for_each_entry(dd, &qib_dev_list, list)
6209 if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322) 6208 if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322)
6210 set_no_qsfp_atten(dd, 1); 6209 set_no_qsfp_atten(dd, 1);