aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2015-05-12 13:42:42 -0400
committerDoug Ledford <dledford@redhat.com>2015-05-12 13:55:41 -0400
commitec40f925e0151e3c130fce2b5a1c6389c5b5e4dd (patch)
tree9385bb362750aea488df11d38a2bf35d9675e6fc
parentec04847c0c5b471bab2dacceadfdb803a9d1a2ea (diff)
IB/qib: fix test of unsigned variable
Commit d4988623cc60 ("IB/qib: use arch_phys_wc_add()") adjusted mtrr inititialization to use the new interface. Unfortunately, the new interface returns a signed value and the patch tested the unsigned wc_cookie. Fix the issue by changing the type of wc_cookie to int. For the success case the ret left at zero to avoid a warning from the caller. For failure wc_cookie is used as the ret. Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/qib/qib.h2
-rw-r--r--drivers/infiniband/hw/qib/qib_wc_x86_64.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
index ba5173e24973..7df16f74bb45 100644
--- a/drivers/infiniband/hw/qib/qib.h
+++ b/drivers/infiniband/hw/qib/qib.h
@@ -903,7 +903,7 @@ struct qib_devdata {
903 /* PCI Device ID (here for NodeInfo) */ 903 /* PCI Device ID (here for NodeInfo) */
904 u16 deviceid; 904 u16 deviceid;
905 /* for write combining settings */ 905 /* for write combining settings */
906 unsigned long wc_cookie; 906 int wc_cookie;
907 unsigned long wc_base; 907 unsigned long wc_base;
908 unsigned long wc_len; 908 unsigned long wc_len;
909 909
diff --git a/drivers/infiniband/hw/qib/qib_wc_x86_64.c b/drivers/infiniband/hw/qib/qib_wc_x86_64.c
index 6d61ef98721c..edd0ddbd4481 100644
--- a/drivers/infiniband/hw/qib/qib_wc_x86_64.c
+++ b/drivers/infiniband/hw/qib/qib_wc_x86_64.c
@@ -118,7 +118,8 @@ int qib_enable_wc(struct qib_devdata *dd)
118 if (!ret) { 118 if (!ret) {
119 dd->wc_cookie = arch_phys_wc_add(pioaddr, piolen); 119 dd->wc_cookie = arch_phys_wc_add(pioaddr, piolen);
120 if (dd->wc_cookie < 0) 120 if (dd->wc_cookie < 0)
121 ret = -EINVAL; 121 /* use error from routine */
122 ret = dd->wc_cookie;
122 } 123 }
123 124
124 return ret; 125 return ret;