diff options
| author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-18 10:28:37 -0500 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-18 10:28:37 -0500 |
| commit | 65d2918e716afb89359cfa59734d76c1ff8700cb (patch) | |
| tree | 4685404f96642243d62c3a1a823340913d087090 /lib/mpi | |
| parent | bf40e5561fd288a505d5d8d8bf45eef96fe7253d (diff) | |
| parent | 338d00cfef07d74a072f96821c64b20f98517d72 (diff) | |
Merge branch 'cleanups'
Merge cleanups requested by Linus.
* cleanups: (3 commits)
pnfs: Refactor the *_layout_mark_request_commit to use pnfs_layout_mark_request_commit
nfs: Can call nfs_clear_page_commit() instead
nfs: Provide and use helper functions for marking a page as unstable
Diffstat (limited to 'lib/mpi')
| -rw-r--r-- | lib/mpi/mpi-cmp.c | 10 | ||||
| -rw-r--r-- | lib/mpi/mpi-internal.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/mpi/mpi-cmp.c b/lib/mpi/mpi-cmp.c index 1871e7b61ca0..d25e9e96c310 100644 --- a/lib/mpi/mpi-cmp.c +++ b/lib/mpi/mpi-cmp.c | |||
| @@ -57,14 +57,12 @@ int mpi_cmp(MPI u, MPI v) | |||
| 57 | if (usize != vsize && !u->sign && !v->sign) | 57 | if (usize != vsize && !u->sign && !v->sign) |
| 58 | return usize - vsize; | 58 | return usize - vsize; |
| 59 | if (usize != vsize && u->sign && v->sign) | 59 | if (usize != vsize && u->sign && v->sign) |
| 60 | return vsize + usize; | 60 | return vsize - usize; |
| 61 | if (!usize) | 61 | if (!usize) |
| 62 | return 0; | 62 | return 0; |
| 63 | cmp = mpihelp_cmp(u->d, v->d, usize); | 63 | cmp = mpihelp_cmp(u->d, v->d, usize); |
| 64 | if (!cmp) | 64 | if (u->sign) |
| 65 | return 0; | 65 | return -cmp; |
| 66 | if ((cmp < 0 ? 1 : 0) == (u->sign ? 1 : 0)) | 66 | return cmp; |
| 67 | return 1; | ||
| 68 | return -1; | ||
| 69 | } | 67 | } |
| 70 | EXPORT_SYMBOL_GPL(mpi_cmp); | 68 | EXPORT_SYMBOL_GPL(mpi_cmp); |
diff --git a/lib/mpi/mpi-internal.h b/lib/mpi/mpi-internal.h index 60cf765628e9..c65dd1bff45a 100644 --- a/lib/mpi/mpi-internal.h +++ b/lib/mpi/mpi-internal.h | |||
| @@ -84,7 +84,7 @@ static inline int RESIZE_IF_NEEDED(MPI a, unsigned b) | |||
| 84 | do { \ | 84 | do { \ |
| 85 | mpi_size_t _i; \ | 85 | mpi_size_t _i; \ |
| 86 | for (_i = 0; _i < (n); _i++) \ | 86 | for (_i = 0; _i < (n); _i++) \ |
| 87 | (d)[_i] = (d)[_i]; \ | 87 | (d)[_i] = (s)[_i]; \ |
| 88 | } while (0) | 88 | } while (0) |
| 89 | 89 | ||
| 90 | #define MPN_COPY_DECR(d, s, n) \ | 90 | #define MPN_COPY_DECR(d, s, n) \ |
