diff options
author | Roland Dreier <roland@topspin.com> | 2005-04-16 18:26:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:26:32 -0400 |
commit | d10ddbf6d7f6699c386d1f41bf542189de32b6be (patch) | |
tree | b2e3ab95925407472fa9c62bb6016d85f822cb68 /drivers/infiniband/hw/mthca/mthca_profile.c | |
parent | 6bd6228eed52ef188ebe46865ccff72da936c968 (diff) |
[PATCH] IB/mthca: encapsulate mem-free check into mthca_is_memfree()
Clean up mem-free mode support by introducing mthca_is_memfree() function,
which encapsulates the logic of deciding if a device is mem-free.
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_profile.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_profile.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_profile.c b/drivers/infiniband/hw/mthca/mthca_profile.c index fd3f167e6460..4fedc32d5871 100644 --- a/drivers/infiniband/hw/mthca/mthca_profile.c +++ b/drivers/infiniband/hw/mthca/mthca_profile.c | |||
@@ -116,11 +116,11 @@ u64 mthca_make_profile(struct mthca_dev *dev, | |||
116 | profile[i].type = i; | 116 | profile[i].type = i; |
117 | profile[i].log_num = max(ffs(profile[i].num) - 1, 0); | 117 | profile[i].log_num = max(ffs(profile[i].num) - 1, 0); |
118 | profile[i].size *= profile[i].num; | 118 | profile[i].size *= profile[i].num; |
119 | if (dev->hca_type == ARBEL_NATIVE) | 119 | if (mthca_is_memfree(dev)) |
120 | profile[i].size = max(profile[i].size, (u64) PAGE_SIZE); | 120 | profile[i].size = max(profile[i].size, (u64) PAGE_SIZE); |
121 | } | 121 | } |
122 | 122 | ||
123 | if (dev->hca_type == ARBEL_NATIVE) { | 123 | if (mthca_is_memfree(dev)) { |
124 | mem_base = 0; | 124 | mem_base = 0; |
125 | mem_avail = dev_lim->hca.arbel.max_icm_sz; | 125 | mem_avail = dev_lim->hca.arbel.max_icm_sz; |
126 | } else { | 126 | } else { |
@@ -165,7 +165,7 @@ u64 mthca_make_profile(struct mthca_dev *dev, | |||
165 | (unsigned long long) profile[i].size); | 165 | (unsigned long long) profile[i].size); |
166 | } | 166 | } |
167 | 167 | ||
168 | if (dev->hca_type == ARBEL_NATIVE) | 168 | if (mthca_is_memfree(dev)) |
169 | mthca_dbg(dev, "HCA context memory: reserving %d KB\n", | 169 | mthca_dbg(dev, "HCA context memory: reserving %d KB\n", |
170 | (int) (total_size >> 10)); | 170 | (int) (total_size >> 10)); |
171 | else | 171 | else |
@@ -267,7 +267,7 @@ u64 mthca_make_profile(struct mthca_dev *dev, | |||
267 | * out of the MR pool. They don't use additional memory, but | 267 | * out of the MR pool. They don't use additional memory, but |
268 | * we assign them as part of the HCA profile anyway. | 268 | * we assign them as part of the HCA profile anyway. |
269 | */ | 269 | */ |
270 | if (dev->hca_type == ARBEL_NATIVE) | 270 | if (mthca_is_memfree(dev)) |
271 | dev->limits.fmr_reserved_mtts = 0; | 271 | dev->limits.fmr_reserved_mtts = 0; |
272 | else | 272 | else |
273 | dev->limits.fmr_reserved_mtts = request->fmr_reserved_mtts; | 273 | dev->limits.fmr_reserved_mtts = request->fmr_reserved_mtts; |