From: Damien Lespiau Date: Fri, 8 Aug 2014 17:50:18 +0000 (+0100) Subject: drm: Don't return 0 for a value used as a denominator X-Git-Tag: v3.18-rc1~44^2~79^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c11cda52193dfa459dfea38f00b19bc9325fa922;p=thirdparty%2Flinux.git drm: Don't return 0 for a value used as a denominator Static analysis will be unhappy if a function can theoretically return 0 and we're trying to divide by that value. Mark that case that cannot occur as a BUG() instead. Signed-off-by: Damien Lespiau Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 352f5d6c763cc..b3adf14450205 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1772,7 +1772,7 @@ static int drm_dp_get_vc_payload_bw(int dp_link_bw, int dp_link_count) case DP_LINK_BW_5_4: return 10 * dp_link_count; } - return 0; + BUG(); } /**