Skip to content

Commit

Permalink
IB/qib: fix test of unsigned variable
Browse files Browse the repository at this point in the history
Commit d498862 ("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>
  • Loading branch information
Mike Marciniszyn authored and Doug Ledford committed May 12, 2015
1 parent ec04847 commit ec40f92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/qib/qib.h
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ struct qib_devdata {
/* PCI Device ID (here for NodeInfo) */
u16 deviceid;
/* for write combining settings */
unsigned long wc_cookie;
int wc_cookie;
unsigned long wc_base;
unsigned long wc_len;

Expand Down
3 changes: 2 additions & 1 deletion drivers/infiniband/hw/qib/qib_wc_x86_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ int qib_enable_wc(struct qib_devdata *dd)
if (!ret) {
dd->wc_cookie = arch_phys_wc_add(pioaddr, piolen);
if (dd->wc_cookie < 0)
ret = -EINVAL;
/* use error from routine */
ret = dd->wc_cookie;
}

return ret;
Expand Down

0 comments on commit ec40f92

Please sign in to comment.