From patchwork Sat Jan 14 21:18:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 4027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp452029wrn; Sat, 14 Jan 2023 13:21:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXvcIwvySrd02nT13VDJYX03bac8EdWF4NOm3DUhXu91sZ9+HFLbqu/iU/0PEzDPblvJt2Ej X-Received: by 2002:a17:902:c94d:b0:194:7c28:3fa4 with SMTP id i13-20020a170902c94d00b001947c283fa4mr5538106pla.19.1673731269024; Sat, 14 Jan 2023 13:21:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673731269; cv=none; d=google.com; s=arc-20160816; b=p0VOOEzvOC4/w0CXPj/IpuXof7npDtjoLljxiaY4ICtdjjTVqS6lOZ/t2HixF6LQLh qPDLNAiA+jmtqRfNo1jcP3RmchiLToqlUi6w70VmZ1RX3S9xv9DwQbZRotuOeBxIhAFV i+5PAb87iqFZzncOWkSskYaLFZjvP76Bwt8LjzryYzFjBOYvkz+kU0oFdMOJJqBGpVrP PDApfmTx0+ZrQDhCgcjgN0U0sgrJ1rLxt6WLTjnWUlkx+Sr+fTkgdA46dQme5OrdeTmm 13lpHK/x6gvyCx6e7dwYXU8nMPZLrXpIeRHl378lL2VcCBdAxtrgG95K8JzHjaPyWYWk heKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=rUvOETAZqIgY5vY1ThZe2gvmLwzvKpEB58Fb7lA56v8=; b=zWRH67Tu+fYR2vhUPowCAAL9pFtuopURWhNJLnIBwMei+Tg/k7snQzo41M8Ql6S+AZ TyIg8OYu5XhH+S2Rpce6CqbRltPIzkwvA/NsQlW4KGm22Is33/kGJJC1Dtpzm75jrJjF MKY+nWe3NUfx+cgqY7fIC9m9nLzQwxtLDWMZvwMkaE08XBSbkuCx5Rn2OINVfIRE8r9l rboy8Ob/BsvTnPqy5WL1t0XZlp2PLhsaIQhVTTLP7OnmJfj2wUIrOGC8phDPuMx4Q+fm pa/S3+706jeNf4pLzilwI71qtiBO97DI0fiqlkX2ycW3YvUXkQN6pmi0smvO4kXxuWXh xlPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=AvFRc7+n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020a170902ecc400b00189aab9cdbcsi26094795plh.605.2023.01.14.13.20.57; Sat, 14 Jan 2023 13:21:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=AvFRc7+n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbjANVTJ (ORCPT + 99 others); Sat, 14 Jan 2023 16:19:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230224AbjANVTB (ORCPT ); Sat, 14 Jan 2023 16:19:01 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 268589EC4 for ; Sat, 14 Jan 2023 13:18:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1673731129; bh=3TmlAYNT5GDcotyrQzGG/ieTPPZo+e5QhheiYHUPMHY=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=AvFRc7+n8i2Nw7E7jr053MWfQ3L+4QV74ebbNGgh02HmrJS7l7Ud4DhvINXL/0abD pfbHyHPNKw3yfeQF7xMqkoAxrEXgf1UW5/Ppm5I9Tlo8QvjFoTFObGTT4k/DRHt8+o V1ULwSMTT30mchpwgC2/Sju75f070DoziBcPsp74= Received: by b-6.in.mailobj.net [192.168.90.16] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sat, 14 Jan 2023 22:18:49 +0100 (CET) X-EA-Auth: uVnKFoCMuV/obeMLZg8OScqnQxIJEr+NAWTtfpnll7R0imO4Icz5jqfWj1Y0SEym1IVEkawUgpbFlxBdodPz4zy952dcvsaR Date: Sun, 15 Jan 2023 02:48:45 +0530 From: Deepak R Varma To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , Christian =?iso-8859-1?q?K=F6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar Subject: [PATCH 0/4] drm/amd/display: Use min()/max() helper macros Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755034438780481423?= X-GMAIL-MSGID: =?utf-8?q?1755034438780481423?= This patch series proposes using standard min() / max() helper macros instead of direct variable comparison using the ternary operator or if/else evaluations. I have tested the change using a dummy module and similar simulations on my x86 machine. Deepak R Varma (4): drm/amd/display: Use min()/max() macros in dcn_calc_math drm/amd/display: dcn20: Use min()/max() helper macros drm/amd/display: dcn21: Use min()/max() helper macros drm/amd/display: dcn32: Use min()/max() helper macros .../gpu/drm/amd/display/dc/dml/calcs/dcn_calc_math.c | 10 +++++----- .../drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c | 5 +---- .../amd/display/dc/dml/dcn20/display_mode_vba_20v2.c | 5 +---- .../drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c | 5 +---- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 4 ++-- 5 files changed, 10 insertions(+), 19 deletions(-)