From: Roland Dreier Simplify some of the code for CQ handling slightly. Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton --- 25-akpm/drivers/infiniband/hw/mthca/mthca_cq.c | 16 ++++++---------- 1 files changed, 6 insertions(+), 10 deletions(-) diff -puN drivers/infiniband/hw/mthca/mthca_cq.c~ib-mthca-cq-cleanups drivers/infiniband/hw/mthca/mthca_cq.c --- 25/drivers/infiniband/hw/mthca/mthca_cq.c~ib-mthca-cq-cleanups 2005-03-03 17:39:55.000000000 -0800 +++ 25-akpm/drivers/infiniband/hw/mthca/mthca_cq.c 2005-03-03 17:39:55.000000000 -0800 @@ -150,9 +150,8 @@ static inline struct mthca_cqe *get_cqe( static inline struct mthca_cqe *cqe_sw(struct mthca_cq *cq, int i) { - struct mthca_cqe *cqe; - cqe = get_cqe(cq, i); - return (MTHCA_CQ_ENTRY_OWNER_HW & cqe->owner) ? NULL : cqe; + struct mthca_cqe *cqe = get_cqe(cq, i); + return MTHCA_CQ_ENTRY_OWNER_HW & cqe->owner ? NULL : cqe; } static inline struct mthca_cqe *next_cqe_sw(struct mthca_cq *cq) @@ -378,7 +377,7 @@ static inline int mthca_poll_one(struct struct mthca_wq *wq; struct mthca_cqe *cqe; int wqe_index; - int is_error = 0; + int is_error; int is_send; int free_cqe = 1; int err = 0; @@ -401,12 +400,9 @@ static inline int mthca_poll_one(struct dump_cqe(cqe); } - if ((cqe->opcode & MTHCA_ERROR_CQE_OPCODE_MASK) == - MTHCA_ERROR_CQE_OPCODE_MASK) { - is_error = 1; - is_send = cqe->opcode & 1; - } else - is_send = cqe->is_send & 0x80; + is_error = (cqe->opcode & MTHCA_ERROR_CQE_OPCODE_MASK) == + MTHCA_ERROR_CQE_OPCODE_MASK; + is_send = is_error ? cqe->opcode & 0x01 : cqe->is_send & 0x80; if (!*cur_qp || be32_to_cpu(cqe->my_qpn) != (*cur_qp)->qpn) { if (*cur_qp) { _