From patchwork Thu Jan 12 13:51:30 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: 42445 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3894451wrt; Thu, 12 Jan 2023 06:01:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXvqAvbddy83fvddXMnlhIXOrveUK0aie+mpYKUfuJ4t7/wa+Irv+5VuVQamGaAF9p8aiS/P X-Received: by 2002:a17:90b:1010:b0:227:1e67:d588 with SMTP id gm16-20020a17090b101000b002271e67d588mr13254903pjb.23.1673532076838; Thu, 12 Jan 2023 06:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673532076; cv=none; d=google.com; s=arc-20160816; b=XM5vA3mfTN5HmucoVynipJ+n4YX6G+FVc0TJPhucC8NIWAl7roQQXbQ/JgKPddxtLR vH973agNpPlsJ+QWMJ8jt5Q1vcTae5K6Et7yRbJ+E6sog/AZ/0LTboxYUFz1/YfxfzjO yXYmkj2iscyk/PAlum4g4wI22l3Nnlroo+OCGTEuqyM4w9xMIcyrg5rgiaJN29Mu4VQ5 hMyUNthg68MZdrgzTnWgKG39ZaF5dg46ITRjt9OhWnDSxUEU5fWOf3JzYINdMLhln5Wd Jl30tbRxGKqiB1KzU1XMl/v2V1eN/Cwc18p3jjuKXIimWSC3Ntlc12ypdN4FfriQOd5X DSoQ== 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=gtb9TKEAuKf0ldh2jGkcqOTWKiJwaPptOwY1z0TBvl0=; b=xNsp9/DHz5+INLHRbKeoIsT9oyG0HpZNT/J/d20tf5KSaXa20Q2JoFu0LXKru/N7dt Jw45cYOJPaX+ItTqStRv+EnGe05a10GKv/AzQymRIrOPEciPsCFDJ8+35bLV90+b8OCP H+YmaZPretepi2mzfK6bv3mFqCEHWSfPCDuNErwSgZQwefBZKw/19IjMprDqVaCG8W1b tHMsDc9b502BQXct0NtFMCxjCW3QagMek5NP99+evXvSLo+QJThrFOgy97TajAUTic8j olI2vrnsYB+rNxSFBNiUVrpXAA3z7z3cbSbM4dv+IIOAJnyd1M0Kve2criqM44UZflp6 /zgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=hsLsYzmB; 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 e15-20020a17090a118f00b002213d3227d1si19996603pja.169.2023.01.12.06.01.02; Thu, 12 Jan 2023 06:01:16 -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=hsLsYzmB; 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 S232651AbjALNwH (ORCPT + 99 others); Thu, 12 Jan 2023 08:52:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbjALNvt (ORCPT ); Thu, 12 Jan 2023 08:51:49 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C870517F2 for ; Thu, 12 Jan 2023 05:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1673531496; bh=ZAn7ZSvuny3A40ep6L1C3DqFhwPZfavNHTKFbfUsRxU=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=hsLsYzmBjETINLz1Ja9/z1RFZVcBYUbHn7a9lGQeWWxVIR2aOvEaCHM3hW/0vW3Wg 4uQveX+YjNjCQ7FeCzMA0owVm4zZaIibEUhv69J8B1+mduCsJuL/r6IvseMXRAIcLL UKBbH2XziNiSDioZE0ffoofCAATDAKel1aRhBse4= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via ip-206.mailobj.net [213.182.55.206] Thu, 12 Jan 2023 14:51:36 +0100 (CET) X-EA-Auth: Jql7kLVBTRErAY5Y8kPmRih3iDlhh+Av3Q2tRc5pWKa4/h+rUuSd4pAfiyzp58G/Z7umku8+u+IV1WMtssm9vCSzWYHyaSk2 Date: Thu, 12 Jan 2023 19:21:30 +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] drm/amd/display: Conversion to bool not necessary 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?1754825570835999944?= X-GMAIL-MSGID: =?utf-8?q?1754825570835999944?= A logical evaluation already results in bool. There is no need for using a ternary operator based evaluation and bool conversion of the outcome. Issue identified using boolconv.cocci Coccinelle semantic patch. This was also reported by the Kernel Test Robot. Hence Fixes: 473683a03495 ("drm/amd/display: Create a file dedicated for CRTC") Reported-by: kernel test robot Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c index 22125daf9dcf..1e39d0939700 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c @@ -105,8 +105,7 @@ static void vblank_control_worker(struct work_struct *work) else if (dm->active_vblank_irq_count) dm->active_vblank_irq_count--; - dc_allow_idle_optimizations( - dm->dc, dm->active_vblank_irq_count == 0 ? true : false); + dc_allow_idle_optimizations(dm->dc, dm->active_vblank_irq_count == 0); DRM_DEBUG_KMS("Allow idle optimizations (MALL): %d\n", dm->active_vblank_irq_count == 0);