From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752691AbdK2DFe (ORCPT ); Tue, 28 Nov 2017 22:05:34 -0500 Received: from scorn.kernelslacker.org ([45.56.101.199]:60466 "EHLO scorn.kernelslacker.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751427AbdK2DFd (ORCPT ); Tue, 28 Nov 2017 22:05:33 -0500 Date: Tue, 28 Nov 2017 22:05:31 -0500 From: Dave Jones To: Linux Kernel Mailing List Cc: Dmytro Laktyushkin , Tony Cheng , Harry Wentland , Alex Deucher Subject: Re: drm/amd/display: Restructuring and cleaning up DML Message-ID: <20171129030531.GA13413@codemonkey.org.uk> Mail-Followup-To: Dave Jones , Linux Kernel Mailing List , Dmytro Laktyushkin , Tony Cheng , Harry Wentland , Alex Deucher References: <20171118000201.31E1B21C31@pdx-korg-gitolite-1.ci.codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171118000201.31E1B21C31@pdx-korg-gitolite-1.ci.codeaurora.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Note: SpamAssassin invocation failed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 18, 2017 at 12:02:01AM +0000, Linux Kernel wrote: > Web: https://git.kernel.org/torvalds/c/6d04ee9dc10149db842d41de66eca201c9d91b60 > Commit: 6d04ee9dc10149db842d41de66eca201c9d91b60 > Parent: 19b7fe4a48efbe0f7e8c496b040c4eb16ff02313 > Refname: refs/heads/master > Author: Dmytro Laktyushkin > AuthorDate: Wed Aug 23 16:43:17 2017 -0400 > Committer: Alex Deucher > CommitDate: Sat Oct 21 16:45:24 2017 -0400 > > drm/amd/display: Restructuring and cleaning up DML > > Signed-off-by: Dmytro Laktyushkin > Reviewed-by: Tony Cheng > Acked-by: Harry Wentland > Signed-off-by: Alex Deucher > --- > diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c > index a18474437990..b6abe0f3bb15 100644 > --- a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c > +++ b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c > @@ -27,20 +27,36 @@ > > float dcn_bw_mod(const float arg1, const float arg2) > { > + if (arg1 != arg1) > + return arg2; > + if (arg2 != arg2) > + return arg1; > return arg1 - arg1 * ((int) (arg1 / arg2)); > } > > float dcn_bw_min2(const float arg1, const float arg2) > { > + if (arg1 != arg1) > + return arg2; > + if (arg2 != arg2) > + return arg1; > return arg1 < arg2 ? arg1 : arg2; > } > > unsigned int dcn_bw_max(const unsigned int arg1, const unsigned int arg2) > { > + if (arg1 != arg1) > + return arg2; > + if (arg2 != arg2) > + return arg1; > return arg1 > arg2 ? arg1 : arg2; > } > float dcn_bw_max2(const float arg1, const float arg2) > { > + if (arg1 != arg1) > + return arg2; > + if (arg2 != arg2) > + return arg1; > return arg1 > arg2 ? arg1 : arg2; > } This looks really, really bizarre. What was the intention here ? (This, and a bunch of other stuff in this driver picked up by Coverity, sign up at scan.coverity.com if you want access, and I'll approve.) Dave