提交 ec40f925 编写于 作者: M Mike Marciniszyn 提交者: Doug Ledford

IB/qib: fix test of unsigned variable

Commit d4988623 ("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: NMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 ec04847c
...@@ -903,7 +903,7 @@ struct qib_devdata { ...@@ -903,7 +903,7 @@ struct qib_devdata {
/* PCI Device ID (here for NodeInfo) */ /* PCI Device ID (here for NodeInfo) */
u16 deviceid; u16 deviceid;
/* for write combining settings */ /* for write combining settings */
unsigned long wc_cookie; int wc_cookie;
unsigned long wc_base; unsigned long wc_base;
unsigned long wc_len; unsigned long wc_len;
......
...@@ -118,7 +118,8 @@ int qib_enable_wc(struct qib_devdata *dd) ...@@ -118,7 +118,8 @@ int qib_enable_wc(struct qib_devdata *dd)
if (!ret) { if (!ret) {
dd->wc_cookie = arch_phys_wc_add(pioaddr, piolen); dd->wc_cookie = arch_phys_wc_add(pioaddr, piolen);
if (dd->wc_cookie < 0) if (dd->wc_cookie < 0)
ret = -EINVAL; /* use error from routine */
ret = dd->wc_cookie;
} }
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册