diff options
author | Andy Grover <andy.grover@oracle.com> | 2010-01-12 14:56:44 -0500 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:11:32 -0400 |
commit | 8690bfa17aea4c42da1bcf90a7af93d161eca624 (patch) | |
tree | 88c4c5fa63aab0c18cf13228c4b3a6f980aa74be /net/rds/ib_recv.c | |
parent | 2dc393573430f853e56e25bf4b41c34ba2aa8fd6 (diff) |
RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons
Favor "if (foo)" style over "if (foo != NULL)".
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/ib_recv.c')
-rw-r--r-- | net/rds/ib_recv.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index c74e9904a6b2..d0ee9c114c6c 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c | |||
@@ -53,7 +53,7 @@ static void rds_ib_frag_drop_page(struct rds_page_frag *frag) | |||
53 | static void rds_ib_frag_free(struct rds_page_frag *frag) | 53 | static void rds_ib_frag_free(struct rds_page_frag *frag) |
54 | { | 54 | { |
55 | rdsdebug("frag %p page %p\n", frag, frag->f_page); | 55 | rdsdebug("frag %p page %p\n", frag, frag->f_page); |
56 | BUG_ON(frag->f_page != NULL); | 56 | BUG_ON(frag->f_page); |
57 | kmem_cache_free(rds_ib_frag_slab, frag); | 57 | kmem_cache_free(rds_ib_frag_slab, frag); |
58 | } | 58 | } |
59 | 59 | ||
@@ -143,14 +143,14 @@ static int rds_ib_recv_refill_one(struct rds_connection *conn, | |||
143 | struct ib_sge *sge; | 143 | struct ib_sge *sge; |
144 | int ret = -ENOMEM; | 144 | int ret = -ENOMEM; |
145 | 145 | ||
146 | if (recv->r_ibinc == NULL) { | 146 | if (!recv->r_ibinc) { |
147 | if (!atomic_add_unless(&rds_ib_allocation, 1, rds_ib_sysctl_max_recv_allocation)) { | 147 | if (!atomic_add_unless(&rds_ib_allocation, 1, rds_ib_sysctl_max_recv_allocation)) { |
148 | rds_ib_stats_inc(s_ib_rx_alloc_limit); | 148 | rds_ib_stats_inc(s_ib_rx_alloc_limit); |
149 | goto out; | 149 | goto out; |
150 | } | 150 | } |
151 | recv->r_ibinc = kmem_cache_alloc(rds_ib_incoming_slab, | 151 | recv->r_ibinc = kmem_cache_alloc(rds_ib_incoming_slab, |
152 | kptr_gfp); | 152 | kptr_gfp); |
153 | if (recv->r_ibinc == NULL) { | 153 | if (!recv->r_ibinc) { |
154 | atomic_dec(&rds_ib_allocation); | 154 | atomic_dec(&rds_ib_allocation); |
155 | goto out; | 155 | goto out; |
156 | } | 156 | } |
@@ -158,17 +158,17 @@ static int rds_ib_recv_refill_one(struct rds_connection *conn, | |||
158 | rds_inc_init(&recv->r_ibinc->ii_inc, conn, conn->c_faddr); | 158 | rds_inc_init(&recv->r_ibinc->ii_inc, conn, conn->c_faddr); |
159 | } | 159 | } |
160 | 160 | ||
161 | if (recv->r_frag == NULL) { | 161 | if (!recv->r_frag) { |
162 | recv->r_frag = kmem_cache_alloc(rds_ib_frag_slab, kptr_gfp); | 162 | recv->r_frag = kmem_cache_alloc(rds_ib_frag_slab, kptr_gfp); |
163 | if (recv->r_frag == NULL) | 163 | if (!recv->r_frag) |
164 | goto out; | 164 | goto out; |
165 | INIT_LIST_HEAD(&recv->r_frag->f_item); | 165 | INIT_LIST_HEAD(&recv->r_frag->f_item); |
166 | recv->r_frag->f_page = NULL; | 166 | recv->r_frag->f_page = NULL; |
167 | } | 167 | } |
168 | 168 | ||
169 | if (ic->i_frag.f_page == NULL) { | 169 | if (!ic->i_frag.f_page) { |
170 | ic->i_frag.f_page = alloc_page(page_gfp); | 170 | ic->i_frag.f_page = alloc_page(page_gfp); |
171 | if (ic->i_frag.f_page == NULL) | 171 | if (!ic->i_frag.f_page) |
172 | goto out; | 172 | goto out; |
173 | ic->i_frag.f_offset = 0; | 173 | ic->i_frag.f_offset = 0; |
174 | } | 174 | } |
@@ -757,7 +757,7 @@ static void rds_ib_process_recv(struct rds_connection *conn, | |||
757 | * into the inc and save the inc so we can hang upcoming fragments | 757 | * into the inc and save the inc so we can hang upcoming fragments |
758 | * off its list. | 758 | * off its list. |
759 | */ | 759 | */ |
760 | if (ibinc == NULL) { | 760 | if (!ibinc) { |
761 | ibinc = recv->r_ibinc; | 761 | ibinc = recv->r_ibinc; |
762 | recv->r_ibinc = NULL; | 762 | recv->r_ibinc = NULL; |
763 | ic->i_ibinc = ibinc; | 763 | ic->i_ibinc = ibinc; |
@@ -940,13 +940,13 @@ int __init rds_ib_recv_init(void) | |||
940 | rds_ib_incoming_slab = kmem_cache_create("rds_ib_incoming", | 940 | rds_ib_incoming_slab = kmem_cache_create("rds_ib_incoming", |
941 | sizeof(struct rds_ib_incoming), | 941 | sizeof(struct rds_ib_incoming), |
942 | 0, 0, NULL); | 942 | 0, 0, NULL); |
943 | if (rds_ib_incoming_slab == NULL) | 943 | if (!rds_ib_incoming_slab) |
944 | goto out; | 944 | goto out; |
945 | 945 | ||
946 | rds_ib_frag_slab = kmem_cache_create("rds_ib_frag", | 946 | rds_ib_frag_slab = kmem_cache_create("rds_ib_frag", |
947 | sizeof(struct rds_page_frag), | 947 | sizeof(struct rds_page_frag), |
948 | 0, 0, NULL); | 948 | 0, 0, NULL); |
949 | if (rds_ib_frag_slab == NULL) | 949 | if (!rds_ib_frag_slab) |
950 | kmem_cache_destroy(rds_ib_incoming_slab); | 950 | kmem_cache_destroy(rds_ib_incoming_slab); |
951 | else | 951 | else |
952 | ret = 0; | 952 | ret = 0; |