From fbf8e53d45685e8127551244ffee1ec2af3812f0 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 24 Jul 2017 14:26:51 +0200 Subject: dp.c: fix compilation with gcc 7 With gcc 7 the following compile time error occurs: | drivers/video/tegra/dc/dp.c:1178:12: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parentheses] | cr_done ? : ({ret = -EINVAL; goto fail; }); | ^ | drivers/video/tegra/dc/dp.c:1186:12: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parentheses] | lt_done ? : ({ret = -EINVAL; goto fail; }); | ^ Signed-off-by: Max Krummenacher Acked-by: Marcel Ziswiler --- drivers/video/tegra/dc/dp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/video/tegra/dc/dp.c b/drivers/video/tegra/dc/dp.c index 348c0d7ca176..943e3f115d80 100644 --- a/drivers/video/tegra/dc/dp.c +++ b/drivers/video/tegra/dc/dp.c @@ -1175,7 +1175,10 @@ static int _tegra_dp_fast_lt(struct tegra_dc_dp_data *dp, tegra_dp_tpg(dp, TRAINING_PATTERN_1, n_lanes); tegra_dp_wait_aux_training(dp, true); cr_done = tegra_dp_clock_recovery_status(dp); - cr_done ? : ({ret = -EINVAL; goto fail; }); + if (!cr_done) { + ret = -EINVAL; + goto fail; + } if (cfg->tps3_supported) tegra_dp_tpg(dp, TRAINING_PATTERN_3, n_lanes); @@ -1183,7 +1186,10 @@ static int _tegra_dp_fast_lt(struct tegra_dc_dp_data *dp, tegra_dp_tpg(dp, TRAINING_PATTERN_2, n_lanes); tegra_dp_wait_aux_training(dp, false); lt_done = tegra_dp_lt_status(dp); - lt_done ? : ({ret = -EINVAL; goto fail; }); + if (!lt_done) { + ret = -EINVAL; + goto fail; + } cfg->lt_data_valid = true; -- cgit v1.2.3