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>
此提交包含在:
@@ -230,7 +230,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
|
||||
* the rds_ibdev at all.
|
||||
*/
|
||||
rds_ibdev = ib_get_client_data(dev, &rds_ib_client);
|
||||
if (rds_ibdev == NULL) {
|
||||
if (!rds_ibdev) {
|
||||
if (printk_ratelimit())
|
||||
printk(KERN_NOTICE "RDS/IB: No client_data for device %s\n",
|
||||
dev->name);
|
||||
@@ -306,7 +306,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
|
||||
ic->i_send_ring.w_nr *
|
||||
sizeof(struct rds_header),
|
||||
&ic->i_send_hdrs_dma, GFP_KERNEL);
|
||||
if (ic->i_send_hdrs == NULL) {
|
||||
if (!ic->i_send_hdrs) {
|
||||
ret = -ENOMEM;
|
||||
rdsdebug("ib_dma_alloc_coherent send failed\n");
|
||||
goto out;
|
||||
@@ -316,7 +316,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
|
||||
ic->i_recv_ring.w_nr *
|
||||
sizeof(struct rds_header),
|
||||
&ic->i_recv_hdrs_dma, GFP_KERNEL);
|
||||
if (ic->i_recv_hdrs == NULL) {
|
||||
if (!ic->i_recv_hdrs) {
|
||||
ret = -ENOMEM;
|
||||
rdsdebug("ib_dma_alloc_coherent recv failed\n");
|
||||
goto out;
|
||||
@@ -324,14 +324,14 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
|
||||
|
||||
ic->i_ack = ib_dma_alloc_coherent(dev, sizeof(struct rds_header),
|
||||
&ic->i_ack_dma, GFP_KERNEL);
|
||||
if (ic->i_ack == NULL) {
|
||||
if (!ic->i_ack) {
|
||||
ret = -ENOMEM;
|
||||
rdsdebug("ib_dma_alloc_coherent ack failed\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ic->i_sends = vmalloc(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
|
||||
if (ic->i_sends == NULL) {
|
||||
if (!ic->i_sends) {
|
||||
ret = -ENOMEM;
|
||||
rdsdebug("send allocation failed\n");
|
||||
goto out;
|
||||
@@ -339,7 +339,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
|
||||
memset(ic->i_sends, 0, ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
|
||||
|
||||
ic->i_recvs = vmalloc(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work));
|
||||
if (ic->i_recvs == NULL) {
|
||||
if (!ic->i_recvs) {
|
||||
ret = -ENOMEM;
|
||||
rdsdebug("recv allocation failed\n");
|
||||
goto out;
|
||||
@@ -693,7 +693,7 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)
|
||||
|
||||
/* XXX too lazy? */
|
||||
ic = kzalloc(sizeof(struct rds_ib_connection), GFP_KERNEL);
|
||||
if (ic == NULL)
|
||||
if (!ic)
|
||||
return -ENOMEM;
|
||||
|
||||
INIT_LIST_HEAD(&ic->ib_node);
|
||||
|
新增問題並參考
封鎖使用者