diff options
author | Michael Brown <mcb30@ipxe.org> | 2021-02-01 22:57:57 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2021-02-01 23:00:05 +0000 |
commit | 8747241b3e843ed9771de21d8f2c57c3e67c77c7 (patch) | |
tree | 7daefec168adedca30e2e8b97b31be2f4afd1e08 /src | |
parent | 410566cef7b760b5e59050b38e1eb4e7572f059b (diff) | |
download | ipxe-8747241b3e843ed9771de21d8f2c57c3e67c77c7.tar.gz |
[hermon] Make hermon_dump_xxx() functions no-ops on non-debug builds
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/infiniband/hermon.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c index d13a14678..53e514d5b 100644 --- a/src/drivers/infiniband/hermon.c +++ b/src/drivers/infiniband/hermon.c @@ -823,6 +823,11 @@ hermon_dump_cqctx ( struct hermon *hermon, struct ib_completion_queue *cq ) { struct hermonprm_completion_queue_context cqctx; int rc; + /* Do nothing unless debugging is enabled */ + if ( ! DBG_LOG ) + return 0; + + /* Dump completion queue context */ memset ( &cqctx, 0, sizeof ( cqctx ) ); if ( ( rc = hermon_cmd_query_cq ( hermon, cq->cqn, &cqctx ) ) != 0 ) { DBGC ( hermon, "Hermon %p CQN %#lx QUERY_CQ failed: %s\n", @@ -1102,6 +1107,11 @@ hermon_dump_qpctx ( struct hermon *hermon, struct ib_queue_pair *qp ) { struct hermonprm_qp_ee_state_transitions qpctx; int rc; + /* Do nothing unless debugging is enabled */ + if ( ! DBG_LOG ) + return 0; + + /* Dump queue pair context */ memset ( &qpctx, 0, sizeof ( qpctx ) ); if ( ( rc = hermon_cmd_query_qp ( hermon, qp->qpn, &qpctx ) ) != 0 ) { DBGC ( hermon, "Hermon %p QPN %#lx QUERY_QP failed: %s\n", @@ -1898,6 +1908,11 @@ hermon_dump_eqctx ( struct hermon *hermon, struct hermonprm_eqc eqctx; int rc; + /* Do nothing unless debugging is enabled */ + if ( ! DBG_LOG ) + return 0; + + /* Dump event queue context */ memset ( &eqctx, 0, sizeof ( eqctx ) ); if ( ( rc = hermon_cmd_query_eq ( hermon, hermon_eq->eqn, &eqctx ) ) != 0 ) { @@ -1930,6 +1945,11 @@ hermon_dump_eqes ( struct hermon *hermon, unsigned int idx; int rc; + /* Do nothing unless debugging is enabled */ + if ( ! DBG_LOG ) + return 0; + + /* Dump event queue entries */ memset ( &eqctx, 0, sizeof ( eqctx ) ); if ( ( rc = hermon_cmd_query_eq ( hermon, hermon_eq->eqn, &eqctx ) ) != 0 ) { |