diff options
author | Andy Grover <andy.grover@oracle.com> | 2009-04-09 10:09:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-09 20:21:18 -0400 |
commit | 7acd4a794c1530af063e51f3f7171e75556458f3 (patch) | |
tree | 4c213f984afa23fbb704a9e94f6f754ed50bdb5d /net | |
parent | 7b70d0336da777c00395cc7a503497c2cdabd1a8 (diff) |
RDS: Fix ordering in a conditional
Putting the constant first is a supposed "best practice" that actually makes
the code harder to read.
Thanks to Roland Dreier for finding a bug in this "simple, obviously correct"
patch.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/rds/rdma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/rds/rdma.c b/net/rds/rdma.c index eaeeb91e1119..e390dc70b9d9 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c | |||
@@ -155,7 +155,7 @@ static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages, | |||
155 | nr_pages, write, 0, pages, NULL); | 155 | nr_pages, write, 0, pages, NULL); |
156 | up_read(¤t->mm->mmap_sem); | 156 | up_read(¤t->mm->mmap_sem); |
157 | 157 | ||
158 | if (0 <= ret && (unsigned) ret < nr_pages) { | 158 | if (ret >= 0 && ret < nr_pages) { |
159 | while (ret--) | 159 | while (ret--) |
160 | put_page(pages[ret]); | 160 | put_page(pages[ret]); |
161 | ret = -EFAULT; | 161 | ret = -EFAULT; |