aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/ib_cm.c
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2010-01-12 14:56:44 -0500
committerAndy Grover <andy.grover@oracle.com>2010-09-08 21:11:32 -0400
commit8690bfa17aea4c42da1bcf90a7af93d161eca624 (patch)
tree88c4c5fa63aab0c18cf13228c4b3a6f980aa74be /net/rds/ib_cm.c
parent2dc393573430f853e56e25bf4b41c34ba2aa8fd6 (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_cm.c')
-rw-r--r--net/rds/ib_cm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index f68832798db2..b46bc2f22ab6 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -230,7 +230,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
230 * the rds_ibdev at all. 230 * the rds_ibdev at all.
231 */ 231 */
232 rds_ibdev = ib_get_client_data(dev, &rds_ib_client); 232 rds_ibdev = ib_get_client_data(dev, &rds_ib_client);
233 if (rds_ibdev == NULL) { 233 if (!rds_ibdev) {
234 if (printk_ratelimit()) 234 if (printk_ratelimit())
235 printk(KERN_NOTICE "RDS/IB: No client_data for device %s\n", 235 printk(KERN_NOTICE "RDS/IB: No client_data for device %s\n",
236 dev->name); 236 dev->name);
@@ -306,7 +306,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
306 ic->i_send_ring.w_nr * 306 ic->i_send_ring.w_nr *
307 sizeof(struct rds_header), 307 sizeof(struct rds_header),
308 &ic->i_send_hdrs_dma, GFP_KERNEL); 308 &ic->i_send_hdrs_dma, GFP_KERNEL);
309 if (ic->i_send_hdrs == NULL) { 309 if (!ic->i_send_hdrs) {
310 ret = -ENOMEM; 310 ret = -ENOMEM;
311 rdsdebug("ib_dma_alloc_coherent send failed\n"); 311 rdsdebug("ib_dma_alloc_coherent send failed\n");
312 goto out; 312 goto out;
@@ -316,7 +316,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
316 ic->i_recv_ring.w_nr * 316 ic->i_recv_ring.w_nr *
317 sizeof(struct rds_header), 317 sizeof(struct rds_header),
318 &ic->i_recv_hdrs_dma, GFP_KERNEL); 318 &ic->i_recv_hdrs_dma, GFP_KERNEL);
319 if (ic->i_recv_hdrs == NULL) { 319 if (!ic->i_recv_hdrs) {
320 ret = -ENOMEM; 320 ret = -ENOMEM;
321 rdsdebug("ib_dma_alloc_coherent recv failed\n"); 321 rdsdebug("ib_dma_alloc_coherent recv failed\n");
322 goto out; 322 goto out;
@@ -324,14 +324,14 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
324 324
325 ic->i_ack = ib_dma_alloc_coherent(dev, sizeof(struct rds_header), 325 ic->i_ack = ib_dma_alloc_coherent(dev, sizeof(struct rds_header),
326 &ic->i_ack_dma, GFP_KERNEL); 326 &ic->i_ack_dma, GFP_KERNEL);
327 if (ic->i_ack == NULL) { 327 if (!ic->i_ack) {
328 ret = -ENOMEM; 328 ret = -ENOMEM;
329 rdsdebug("ib_dma_alloc_coherent ack failed\n"); 329 rdsdebug("ib_dma_alloc_coherent ack failed\n");
330 goto out; 330 goto out;
331 } 331 }
332 332
333 ic->i_sends = vmalloc(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work)); 333 ic->i_sends = vmalloc(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
334 if (ic->i_sends == NULL) { 334 if (!ic->i_sends) {
335 ret = -ENOMEM; 335 ret = -ENOMEM;
336 rdsdebug("send allocation failed\n"); 336 rdsdebug("send allocation failed\n");
337 goto out; 337 goto out;
@@ -339,7 +339,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
339 memset(ic->i_sends, 0, ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work)); 339 memset(ic->i_sends, 0, ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
340 340
341 ic->i_recvs = vmalloc(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work)); 341 ic->i_recvs = vmalloc(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work));
342 if (ic->i_recvs == NULL) { 342 if (!ic->i_recvs) {
343 ret = -ENOMEM; 343 ret = -ENOMEM;
344 rdsdebug("recv allocation failed\n"); 344 rdsdebug("recv allocation failed\n");
345 goto out; 345 goto out;
@@ -693,7 +693,7 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)
693 693
694 /* XXX too lazy? */ 694 /* XXX too lazy? */
695 ic = kzalloc(sizeof(struct rds_ib_connection), GFP_KERNEL); 695 ic = kzalloc(sizeof(struct rds_ib_connection), GFP_KERNEL);
696 if (ic == NULL) 696 if (!ic)
697 return -ENOMEM; 697 return -ENOMEM;
698 698
699 INIT_LIST_HEAD(&ic->ib_node); 699 INIT_LIST_HEAD(&ic->ib_node);