aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2013-10-25 11:17:59 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-04 13:56:17 -0500
commit71d7bd9b865fb91fb39501260fafd88c791d9dc5 (patch)
tree0af0323b11498431f4bbdf23600e077345291fe9
parenteef5ed304aa7b49b8f58720855dd299163329db2 (diff)
IB/qib: Fix txselect regression
commit 2fadd83184d58701f1116ca578465b5a75f9417c upstream. 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. Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 3f6b21e9dc11..bd8cb0f89ef1 100644
--- a/drivers/infiniband/hw/qib/qib_iba7322.c
+++ b/drivers/infiniband/hw/qib/qib_iba7322.c
@@ -5853,21 +5853,20 @@ static int setup_txselect(const char *str, struct kernel_param *kp)
5853{ 5853{
5854 struct qib_devdata *dd; 5854 struct qib_devdata *dd;
5855 unsigned long val; 5855 unsigned long val;
5856 int ret; 5856 char *n;
5857
5858 if (strlen(str) >= MAX_ATTEN_LEN) { 5857 if (strlen(str) >= MAX_ATTEN_LEN) {
5859 pr_info("txselect_values string too long\n"); 5858 pr_info("txselect_values string too long\n");
5860 return -ENOSPC; 5859 return -ENOSPC;
5861 } 5860 }
5862 ret = kstrtoul(str, 0, &val); 5861 val = simple_strtoul(str, &n, 0);
5863 if (ret || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + 5862 if (n == str || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ +
5864 TXDDS_MFG_SZ)) { 5863 TXDDS_MFG_SZ)) {
5865 pr_info("txselect_values must start with a number < %d\n", 5864 pr_info("txselect_values must start with a number < %d\n",
5866 TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ); 5865 TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ);
5867 return ret ? ret : -EINVAL; 5866 return -EINVAL;
5868 } 5867 }
5869
5870 strcpy(txselect_list, str); 5868 strcpy(txselect_list, str);
5869
5871 list_for_each_entry(dd, &qib_dev_list, list) 5870 list_for_each_entry(dd, &qib_dev_list, list)
5872 if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322) 5871 if (dd->deviceid == PCI_DEVICE_ID_QLOGIC_IB_7322)
5873 set_no_qsfp_atten(dd, 1); 5872 set_no_qsfp_atten(dd, 1);