Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2363727pxv; Sun, 11 Jul 2021 10:46:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp4KBJUxRujUI3Ec032o5LlKcFdgkjeMGqWOWL9Bnt39GcgyI/nlvLiyNbM2AJzfzj32zM X-Received: by 2002:a5d:9cd9:: with SMTP id w25mr24590337iow.36.1626025593109; Sun, 11 Jul 2021 10:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626025593; cv=none; d=google.com; s=arc-20160816; b=D63Ru08t3xIzyieZEemKUk17dlGwnKTgX6Lu47FHgtwpPQ3NedkslBvmD2zD+0v0sw 7sbvauKIevpvVvUDcjC5NHWlNivSOzH1znOaRXa4ZcHtGIqly3ofRSimMulQOEMiIq0m nJ62i7ysIGEFkmdh7xRG/0iiNVmZLZlEK+5rSFTRl/LStlHPPsRfd2gtX7dUM2WXlyIQ LQRmj5gNN+8qYkHpVf+4Urgq3rNKlWdia+a66lE2ge9XZUHpvh7a1X6bSiyHCNBnVyqa ++BWli5dZ9R7/d9610EOopeZWB3gCPUnMXtNC3c2jo759pnKoqchgcVEYEaPDLDp5bwn dkZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=HhYghZQj+gm+R1hKghEsh63CHxjMaBdwQOeG4rgVxGQ=; b=q84lEuNK99k8uUhlLPR/Aj8oYvl63+3+OSRyCCgeaZ0fk7eCg6DJbcfxnsoo4WSLd3 yx/in1nY1xC1eyAfHYboRctoSnTkVUAfmMYw2PCjHqx3xZnwyxFpTNJd9hEqIP1ALTID n304bs/umPyLKGwQj2J2Pwg4lL/+E+4A84j6s0G2b7Uf95lt4miz1bsMc0lu8I4HOWBU JHjC311Ab/1qZjF601NDugJF8MKEvvAF3S0c31fo9FbupWPwlAwXTYg1FrqSx9x5JajD jyU7XE02+imzLOSly8XAF7zCFumGhv2PpxvidW5BIBa2ZZk15Kdbs0EOKc3BTAXO4+BF y06w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v14si13630343ilj.0.2021.07.11.10.46.21; Sun, 11 Jul 2021 10:46:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232507AbhGKRsm (ORCPT + 99 others); Sun, 11 Jul 2021 13:48:42 -0400 Received: from smtprelay0145.hostedemail.com ([216.40.44.145]:56318 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230399AbhGKRsl (ORCPT ); Sun, 11 Jul 2021 13:48:41 -0400 Received: from omf09.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 37FAE182CF66A; Sun, 11 Jul 2021 17:45:54 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA id 7BF461E04D4; Sun, 11 Jul 2021 17:45:50 +0000 (UTC) Message-ID: Subject: Re: [PATCH] drm/amd/display: Fix identical code for different branches From: Joe Perches To: Len Baker , Harry Wentland , Leo Li , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter Cc: Wenjing Liu , Martin Tsai , Kees Cook , George Shen , Yu-ting Shen , Nicholas Kazlauskas , Bhawanpreet Lakha , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Sun, 11 Jul 2021 10:45:48 -0700 In-Reply-To: <20210711172433.2777-1-len.baker@gmx.com> References: <20210711172433.2777-1-len.baker@gmx.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: 7BF461E04D4 X-Spam-Status: No, score=0.11 X-Stat-Signature: 7ma6bo74edffc1o15s1gyp3aqp9y57xd X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/HO52DK1P6z6FVcGIy7yHO2Mioju5SxhI= X-HE-Tag: 1626025550-417702 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2021-07-11 at 19:24 +0200, Len Baker wrote: > The branches of the "if" statement are the same. So remove the > unnecessary if and goto statements. > > Addresses-Coverity-ID: 1456916 ("Identical code for different branches") > Fixes: 4c283fdac08ab ("drm/amd/display: Add HDCP module") > Signed-off-by: Len Baker I'm not a big fan of this type of change. It's currently the same style used for six tests in this function and changing this last one would just make it harder to see the code blocks as consistent. I doubt any reasonable compiler would produce different objects. > diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c [] > @@ -305,10 +305,8 @@ static enum mod_hdcp_status wait_for_ready(struct mod_hdcp *hdcp, > ? hdcp, "bcaps_read")) > ? goto out; > ? } > - if (!mod_hdcp_execute_and_set(check_ksv_ready, > - &input->ready_check, &status, > - hdcp, "ready_check")) > - goto out; > + mod_hdcp_execute_and_set(check_ksv_ready, &input->ready_check, &status, > + hdcp, "ready_check"); > ?out: > ? return status; > ?} > -- > 2.25.1 >