From patchwork Tue May 17 05:02:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Zhengkui X-Patchwork-Id: 12851899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AA75C433F5 for ; Tue, 17 May 2022 05:02:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2811510EB65; Tue, 17 May 2022 05:02:40 +0000 (UTC) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2113.outbound.protection.outlook.com [40.107.215.113]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BDE210EB65 for ; Tue, 17 May 2022 05:02:39 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L1+cmvwkQJfj3cAhJtmfIDgiZx2RY33pktMmQttZFnpGkTFJD4vNAmZhHEvuwPezDAXQbWZqZET1gk66YyiUfHCpSTSXga3iXSiAlkXkzwg8MjV1/FdTqQw808YmtAGquj4CuvjTnEP3xIF6KoD0va741L66RbB2Mgze41GSl5i0pvYoOlRPr7FpxgKevhTUgPEAok5bEMYoeljBOtExqA3OGhuo45nYA2hI8yqmRzksrONr2qWbgA41NUjRQ/MqBx262sCLvQRNYyNVDKEvwWNOuhpDIRQ8jRjXQy5pwJzwlDf6+acYTbSlaXmZxYx8adcFL884vJBuXvwD6kWtEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+FelbmIHjknLKG8fl0j/q1Kw/+XnwOQZ4oV0mhsmi5k=; b=PrsDN+qLB7TIVyQJ9sWc5cdOmsZyAd5zYajHXFBQol3c4YugTawsepY9OdI6jhCyn69mhhsEXblWL4hsYsvlWk5izQG97ie1YGtXOECWxK3PP6hiW3jOoJRYcJxA/431gS52Y4Ae6HvysvyR9HQB0LHyVRkZKwITpx4Hg4GDgnJ7TOyobJFcth7HPwkIRHW7bE/Zjxwb3gAiWCJMz+S8pg6LZvyZe8vPdJR7KwCUNURrNtx1bZ5AQCCN2fLf/3yFz6IY3j/2ZB08zZp3MtTS1H+VE2yCrIF1D8yENKthAruwwNW4AlO+CB6lAt9EgGa2pD6M4POTLokSgmNcB8bJjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+FelbmIHjknLKG8fl0j/q1Kw/+XnwOQZ4oV0mhsmi5k=; b=gtaKB2xQP5RYR1cMphJYt5k2BGqCYrrjDzTsU7Gb4LjhXeg/eusXcf0YuhZvAqziJl9kx57BLabywtpGTLlohEoHgKbK+rq7Ko4WFeaLZ942oP2xeK2ouHoO01B9jOOYmxW/pli7QI/vUOluBxXdo+T4T7tYNcY4tdJLRyvc+iE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from HK2PR06MB3492.apcprd06.prod.outlook.com (2603:1096:202:2f::10) by SI2PR06MB4235.apcprd06.prod.outlook.com (2603:1096:4:159::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13; Tue, 17 May 2022 05:02:33 +0000 Received: from HK2PR06MB3492.apcprd06.prod.outlook.com ([fe80::88e1:dc04:6851:ad08]) by HK2PR06MB3492.apcprd06.prod.outlook.com ([fe80::88e1:dc04:6851:ad08%7]) with mapi id 15.20.5250.018; Tue, 17 May 2022 05:02:33 +0000 From: Guo Zhengkui To: Tomi Valkeinen , David Airlie , Daniel Vetter , Neil Armstrong , Benoit Parrot , Cai Huoqing , Arnd Bergmann , Guo Zhengkui , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR TI OMAP), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm: omapdrm: dss: replace ternary operator with max() Date: Tue, 17 May 2022 13:02:06 +0800 Message-Id: <20220517050208.121488-1-guozhengkui@vivo.com> X-Mailer: git-send-email 2.20.1 X-ClientProxiedBy: TYCPR01CA0098.jpnprd01.prod.outlook.com (2603:1096:405:4::14) To HK2PR06MB3492.apcprd06.prod.outlook.com (2603:1096:202:2f::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c5d489d-e7ca-4b1a-0dfa-08da37c2737e X-MS-TrafficTypeDiagnostic: SI2PR06MB4235:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kxWi9zaZNQQpU9409p0PKJX/c/0r/vhptSff/s0Nmzn+/OD7NU8r7lQ22lAd+rwbagLfNuGn5R/TSWfg1c9HBOS6aOflDXo0La9iymkF9ubMUNfLhu/GOv2SrhNLfAXTK27qBo90U4wVUIrD9EBm33uC6RNrTj8USOzNvge7lmou2iJbfvqIiuFXLhxqEp9gY1HKzlLWmxQxQsOMTUrrXFFmD3MDbBD2wjsJvltJ9YKqk3731YUNH3i1VPLdFxb7v2jFd0mzt147xxtFF+fyqh1vIESzot4qKnT0Y0m6ztZqsgq3h8PcV1k9bv5piO0nUvNIkVXnkenhPfX6RUZwKk1Gs19YwkFjz6YV0WHuGha5t00BQ+pADV0G9DZZpxjtPOSGST4vugsPv0LI1QWVdm4lVOyxAyh/Ttkcw3JTrZRNXqrFOGwbbTQPXBXtlg/cSncsbOzGl6Cm7Yysjr0XkRoH5cepwmtXxU0nZpaXVBbSC502M/75old/1+tZWOFO0QJO3tp0azWbZ5USgTNXF64PHAJRo1swkbcI7qXZAg27iri/LZCe/eQGPQPzVnAGpjDEzrkAD156qhqYhPWGKmV7qSl718lU2bv1A6LH4Ky0be7Zy0KmtqkHUstR1J9yOSTgL0Nea6oqnlCxl8SaLkvvfy2o0sVVIZbxcO7tvWO24QlJ4SiGrTJzghTGX6Gu7CJarEIoRGL7fuOu40dqnuFqSfex5WP8JlhpjtbvREHFhuV/+ASaN0OQ4cIVa6XIsvE1LXZ/sslk9ZJ00h2gcw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HK2PR06MB3492.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(36756003)(4326008)(110136005)(508600001)(6506007)(66556008)(66946007)(66476007)(6666004)(6512007)(921005)(8676002)(2906002)(2616005)(1076003)(86362001)(186003)(52116002)(6486002)(8936002)(26005)(4744005)(316002)(83380400001)(7416002)(5660300002)(38350700002)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UFe9WSTgTFZeSVuYvLVADmRYHjKN/9MtMX4QtHvbdRJJSO0+nNdn+6iAhMdeFINd2iWsmkFdw6JTau3XsVHevHLfq5fIw1g5g8l7aq0OsLcrl1C25A3t7E3W9WX4xenv7g0vP1V8sI8/McEa/pbASOprS49O7GSQy+3tHHPVvJjIc0Jeg8DyDa0Jf8aY5HsVUXO9ZFcQz3jKHMTW5cDZVT7TfTk/zcWrp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sHb1I2RA8iAeMhzjoKHx/oPgnSdifoNDFeR1KphL6DUadrMkCO4aBxbDmmnCuIj6dzU2/Kvo06pZHFYKI9cqZz640DqXhNYg1FNR5ZOueyrJtv5Zdo0Q9fN9l2w9H5ZUAi2PbhaG9wugU39eJbpep+ExloWKb8uMtAbWItSFQ+wXlOispgCLiuWSNSankl8s+nJtzbBFLsRUeCUk5O1ZMmPds8ZZ9IgdMBORNDfqYuRRzbiDAGBp8YGoeMD/hoWzoDFIYULernvoEExjpo0m7vl1bh4ro3Xo6ikAbu6SwWlSWnVicNSzH4CRlFNSHU/urjAr/EZsXLlnSnDV1OtHR4s8e661KFRArD8o0uw90Cnylvt3yWqeq2oA7scC3Inhh8x+2VsFS59RbS0iknhTyKloWGLQUmQOndh5JhM7Zna6AAEMSDu8V5s+JUObpJRhHINIYCbyOx6sg== X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c5d489d-e7ca-4b1a-0dfa-08da37c2737e X-MS-Exchange-CrossTenant-AuthSource: HK2PR06MB3492.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2022 05:02:33.0295 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nPIRnp0pQ52ydT20qNfPpjxIGGliNysNPWcmbuFUmiWYqPOrZ9HOdt/ccuZMwqf0OVQrzAulFow7VoFRv+H2sQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4235 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhengkui_guo@outlook.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix the following coccicheck warning: drivers/gpu/drm/omapdrm/dss/dispc.c:2454:21-22: WARNING opportunity for max() Signed-off-by: Guo Zhengkui --- drivers/gpu/drm/omapdrm/dss/dispc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index c4de142cc85b..0ee344ebcd1c 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -2451,7 +2451,7 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc, *decim_x = DIV_ROUND_UP(width, in_width_max); - *decim_x = *decim_x > decim_x_min ? *decim_x : decim_x_min; + *decim_x = max(*decim_x, decim_x_min); if (*decim_x > *x_predecim) return -EINVAL;