From patchwork Sun Jan 15 10:00:38 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: 43823 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp672905wrn; Sun, 15 Jan 2023 02:13:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXu+v2PSKJH4N0u21IglgVu5V3+yJruo2IIoH8nq1qG7Z9C9dG/K19efbQ7PsbHB89x/J3K7 X-Received: by 2002:a17:906:1d41:b0:86e:b750:d0fe with SMTP id o1-20020a1709061d4100b0086eb750d0femr3460200ejh.32.1673777637195; Sun, 15 Jan 2023 02:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673777637; cv=none; d=google.com; s=arc-20160816; b=lyCfk/YxNJp6hnI8wCE/pSTziyV4xRMWx6tshGCYUfz/7bDM1SkS5O4nFr39VLGGYa t1xV3hlMXNOPbtcKXGh+4weY3zIBEftUpOKuVacKNL1m1t2ULBa88U8oEyzubTqWEp8Z xvSvbjIOIa3oGrAuJckuVh4dQivzOaogj4YH99g1+SSqKBl+ltIWnevn4yiged6etlrS C7Pknc7YaB4jtiZkltBYKB8sl55Lv1tLU6V1VNa4VsJDL4cibzknC4KfBrtljMi8eY98 ZvKJRjuJmiCgOqveXgtIxD8JKP9iKEkuxa4zcOnBjLVkA8TTFXrNGr7Eb/WnIa3MZgtx m0rg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd22-20020a1709076e1600b008705d3c6d2bsi251946ejc.107.2023.01.15.02.13.28; Sun, 15 Jan 2023 02:13:57 -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 + 99 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-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?1755083059473703697?= X-GMAIL-MSGID: =?utf-8?q?1755083059473703697?= 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 Reviewed-by: Harry Wentland 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; }