Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1684943rwb; Sun, 15 Jan 2023 02:32:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXutwmPuJKW4gDFAwVrIgN0JDleJQ5BGsa08N5ADqah+VbzDJfnEIbZyPJEdJNl3z/2T8QGI X-Received: by 2002:aa7:dc10:0:b0:483:b15a:3206 with SMTP id b16-20020aa7dc10000000b00483b15a3206mr6058785edu.23.1673778763849; Sun, 15 Jan 2023 02:32:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673778763; cv=none; d=google.com; s=arc-20160816; b=wsMRrGz7C1YR5axsB2KokGtKan0T1k6Cn4J2kFjHdssyygsy54wqrKqpYuNiphKcIE 9jF+tICOQjJvi+p8npcwjSC17jWBk44aYBL6nohZQ9F/v0Kw/luETzZPgXa3XM/bynX+ eD2VpHD9Ydnt00jSNSxQUx7KOLyhSsbF0amRktLqWE4U7uKJ36t3uAH5BszFRXbH6Q8b TylYYHmpEla7NYZAJ/wP0UR1LJIor2P32a4e9n7f2IJUF8xFNAFD1bLZ5ZLEZ2Xvjtqv poWhRf7P9AOzGI7BTnyCR5d4iVIBeulX6o6n1vDHvo3jMCDjBQbVo0biN3OcqPjmFYED G7Mw== 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=E8PW3DuawPEJORYPlyEoHVC3ab9jhMFs5xxNNzZNo3w=; b=yUx9FJMe+wJ9JtsloxoZ9YpUy7h6pjnc7vkDd3B0oFqTbUvWJRRNoZC/UGjx3JrExM MOqjhzbD/8/1TKUtHB5XeF1IYyJDxIubqBsn6TkyqnNTKWJKKP/cOwEA2BHefbtiSTFW mZnkCsHHanlgHVyvS4BVPtSiY/XWtNQSjSj/z/6tgJfaSxXNKPDbqcplhAHBwfY9CfFX 7KuhfpUeq4AMnpjJclEzOdJR096K/mSvquPdWRrfd0ZAJ6I2TUULCLgCfN2TQ34MthII xn8HNKeJvc0HB/lCf6nXBrXO+EQr/nyrErvmgvlpRZlJDU7F4TAST8A8kdKgMCILekE8 7stQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b="j/AHSimE"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a50870a000000b0049b63f6cd51si10414625edb.182.2023.01.15.02.32.28; Sun, 15 Jan 2023 02:32:43 -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="j/AHSimE"; 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 S230318AbjAOKAz (ORCPT + 54 others); Sun, 15 Jan 2023 05:00:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbjAOKAx (ORCPT ); Sun, 15 Jan 2023 05:00:53 -0500 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92AB4C16C for ; Sun, 15 Jan 2023 02:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1673776843; bh=/iD5FdGsACL4AeAQezA9XNB8C/O5bx6Q/X5pHtL9znk=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=j/AHSimET66MvDWv+l8/PtEAWvnrhLtKagZQwJmMQZcGGc2STk00RUpyw8LALrtNM ZnsIOPFDKQvAX/0CNhJx6g+LV5WxkZpCK/+5ao00eYs/low/H+qAJjJcLjhzpGnWfw tEoHNhFdf3SdsMewyN0YhTKDmukAc7EcXt/C0cQo= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 15 Jan 2023 11:00:43 +0100 (CET) X-EA-Auth: QUVQkKdtaa3ThPmH0jN9hkKBEF3clhbPL9AScoOFF2o6Ipb8m9b2YiEd1CacQfHgw+lTtqJAFAhum5ZmXRrFw35fBU6TjDC8 Date: Sun, 15 Jan 2023 15:30:38 +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: Simplify same effect if/else blocks Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 The if / else block code has same effect irrespective of the logical evaluation. Hence, simply the implementation by removing the unnecessary conditional evaluation. While at it, also fix the long line checkpatch complaint. Issue identified using cond_no_effect.cocci Coccinelle semantic patch script. Signed-off-by: Deepak R Varma --- Please note: The proposed change is compile tested only. If there are any inbuilt test cases that I should run for further verification, I will appreciate guidance about it. Thank you. drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 0cb8d1f934d1..776209e5d21f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, /* Since phantom pipe programming is moved to post_unlock_program_front_end, * move the SubVP lock to after the phantom pipes have been setup */ - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { - if (dc->hwss.subvp_pipe_control_lock) - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); - } else { - if (dc->hwss.subvp_pipe_control_lock) - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); - } - + if (dc->hwss.subvp_pipe_control_lock) + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, + NULL, subvp_prev_use); return; } -- 2.34.1