IB/qib: fix test of unsigned variable
PATCH v4 1/1 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.
--- drivers/infiniband/hw/qib/qib.h | 2 +- drivers/infiniband/hw/qib/qib_wc_x86_64.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/infiniband/hw/qib/qib.h +1 -1
@@ -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;
drivers/infiniband/hw/qib/qib_wc_x86_64.c +2 -1
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20150512174242.9547.82789.stgit-K+u1se/DcYrLESAwzcoQNrvm/[email protected]
PiBGaXggdGhlIGlzc3VlIGJ5IGNoYW5naW5nIHRoZSB0eXBlIG9mIHdjX2Nvb2tpZSB0byBpbnQu ICBGb3IgdGhlIHN1Y2Nlc3MgY2FzZSB0aGUNCj4gcmV0IGxlZnQgYXQgemVybyB0byBhdm9pZCBh IHdhcm5pbmcgZnJvbSB0aGUgY2FsbGVyLiAgRm9yIGZhaWx1cmUgd2NfY29va2llIGlzIHVzZWQN Cj4gYXMgdGhlIHJldC4NCj4gDQoNCkp1c3QgY29tbWl0IG1lc3NhZ2UgY2hhbmdlLg0K --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 32E1700B9017364D9B60AED9960492BC2570FF8A-RjuIdWtd+YbTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org
Doug Ledford
AppliedQuoted 6 lines · Mike
Quoted 4 lines
Fix the issue by changing the type of
wc_cookieto int. For the success case the ret left at zero to avoid a warning from the caller. For failurewc_cookieis used as the ret.Just commit message change.
Thanks, applied.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD