diff options
author | Fabian Frederick <fabf@skynet.be> | 2015-06-10 16:31:51 (GMT) |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-06-11 05:10:59 (GMT) |
commit | ed0de4a8c9dd6922a55226780b3d55dd751ad878 (patch) | |
tree | 460db33bedbc75471451a04b03cae28f6737df0e /drivers/infiniband/hw/mthca/mthca_profile.c | |
parent | 1156256811e42908fd13c4cfcf32965d8b93f2a8 (diff) | |
download | linux-ed0de4a8c9dd6922a55226780b3d55dd751ad878.tar.xz |
IB/mthca: use swap() in mthca_make_profile()
Use kernel.h macro definition.
Thanks to Julia Lawall for Coccinelle scripting support.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_profile.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_profile.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_profile.c b/drivers/infiniband/hw/mthca/mthca_profile.c index 8edb28a..15d0644 100644 --- a/drivers/infiniband/hw/mthca/mthca_profile.c +++ b/drivers/infiniband/hw/mthca/mthca_profile.c @@ -77,7 +77,6 @@ s64 mthca_make_profile(struct mthca_dev *dev, u64 mem_base, mem_avail; s64 total_size = 0; struct mthca_resource *profile; - struct mthca_resource tmp; int i, j; profile = kzalloc(MTHCA_RES_NUM * sizeof *profile, GFP_KERNEL); @@ -136,11 +135,8 @@ s64 mthca_make_profile(struct mthca_dev *dev, */ for (i = MTHCA_RES_NUM; i > 0; --i) for (j = 1; j < i; ++j) { - if (profile[j].size > profile[j - 1].size) { - tmp = profile[j]; - profile[j] = profile[j - 1]; - profile[j - 1] = tmp; - } + if (profile[j].size > profile[j - 1].size) + swap(profile[j], profile[j - 1]); } for (i = 0; i < MTHCA_RES_NUM; ++i) { |