diff options
author | Joe Perches <joe@perches.com> | 2020-02-11 14:32:47 -0800 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2020-02-18 19:17:30 -0800 |
commit | b21aef7e71de8fa2124b602f2ccab35947b581cb (patch) | |
tree | 0f5a5b2d52d83d0ea7f9355988fac71887c96954 /drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | |
parent | 0f56d3c5d8ea7afdbd1e48e6b5d432f3c5c2d1bb (diff) |
mlx5: Use proper logging and tracing line terminations
netdev_err should use newline termination but mlx5_health_report
is used in a trace output function devlink_health_report where
no newline should be used.
Remove the newlines from a couple formats and add a format string
of "%s\n" to the netdev_err call to not directly output the
logging string.
Also use snprintf to avoid any possible output string overrun.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c index 9599fdd620a8..ce2b41c61090 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c @@ -519,8 +519,9 @@ void mlx5e_reporter_rx_timeout(struct mlx5e_rq *rq) err_ctx.ctx = rq; err_ctx.recover = mlx5e_rx_reporter_timeout_recover; err_ctx.dump = mlx5e_rx_reporter_dump_rq; - sprintf(err_str, "RX timeout on channel: %d, ICOSQ: 0x%x RQ: 0x%x, CQ: 0x%x\n", - icosq->channel->ix, icosq->sqn, rq->rqn, rq->cq.mcq.cqn); + snprintf(err_str, sizeof(err_str), + "RX timeout on channel: %d, ICOSQ: 0x%x RQ: 0x%x, CQ: 0x%x", + icosq->channel->ix, icosq->sqn, rq->rqn, rq->cq.mcq.cqn); mlx5e_health_report(priv, priv->rx_reporter, err_str, &err_ctx); } @@ -534,7 +535,7 @@ void mlx5e_reporter_rq_cqe_err(struct mlx5e_rq *rq) err_ctx.ctx = rq; err_ctx.recover = mlx5e_rx_reporter_err_rq_cqe_recover; err_ctx.dump = mlx5e_rx_reporter_dump_rq; - sprintf(err_str, "ERR CQE on RQ: 0x%x", rq->rqn); + snprintf(err_str, sizeof(err_str), "ERR CQE on RQ: 0x%x", rq->rqn); mlx5e_health_report(priv, priv->rx_reporter, err_str, &err_ctx); } @@ -548,7 +549,7 @@ void mlx5e_reporter_icosq_cqe_err(struct mlx5e_icosq *icosq) err_ctx.ctx = icosq; err_ctx.recover = mlx5e_rx_reporter_err_icosq_cqe_recover; err_ctx.dump = mlx5e_rx_reporter_dump_icosq; - sprintf(err_str, "ERR CQE on ICOSQ: 0x%x", icosq->sqn); + snprintf(err_str, sizeof(err_str), "ERR CQE on ICOSQ: 0x%x", icosq->sqn); mlx5e_health_report(priv, priv->rx_reporter, err_str, &err_ctx); } |