From patchwork Wed May 17 02:20:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 9732123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B0A286022E for ; Wed, 17 May 2017 23:40:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55267287D6 for ; Wed, 17 May 2017 23:40:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49C92287F4; Wed, 17 May 2017 23:40:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F23CC287D6 for ; Wed, 17 May 2017 23:40:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 938CE6E486; Wed, 17 May 2017 23:37:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1402 seconds by postgrey-1.35 at gabe; Wed, 17 May 2017 02:43:38 UTC Received: from gateway36.websitewelcome.com (gateway36.websitewelcome.com [50.116.127.2]) by gabe.freedesktop.org (Postfix) with ESMTPS id 97E716E38C for ; Wed, 17 May 2017 02:43:38 +0000 (UTC) Received: from cm4.websitewelcome.com (unknown [108.167.139.16]) by gateway36.websitewelcome.com (Postfix) with ESMTP id C4CAA4012B895 for ; Tue, 16 May 2017 21:20:14 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cm4.websitewelcome.com with id MELD1v00M0V9LXg01ELEJt; Tue, 16 May 2017 21:20:14 -0500 Received: from [189.152.179.187] (port=39792 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1dAoZR-00039a-8G; Tue, 16 May 2017 21:20:13 -0500 Date: Tue, 16 May 2017 21:20:12 -0500 From: "Gustavo A. R. Silva" To: Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie Subject: [PATCH] gpu: drm: radeon: refactor code Message-ID: <20170517022012.GA11913@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - lists.freedesktop.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.179.187 X-Exim-ID: 1dAoZR-00039a-8G X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.179.187]:39792 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Mailman-Approved-At: Wed, 17 May 2017 23:35:44 +0000 Cc: "Gustavo A. R. Silva" , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Local variable _color_ is assigned to a constant value and it is never updated again. Remove this variable and refactor the code it affects. Addresses-Coverity-ID: 1226745 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index 222a1fa..7235d0c 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c @@ -640,7 +640,6 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc uint32_t vclk_ecp_cntl, crtc_ext_cntl; uint32_t dac_ext_cntl, dac_cntl, dac_macro_cntl, tmp; enum drm_connector_status found = connector_status_disconnected; - bool color = true; /* just don't bother on RN50 those chip are often connected to remoting * console hw and often we get failure to load detect those. So to make @@ -665,12 +664,7 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc WREG32(RADEON_CRTC_EXT_CNTL, tmp); tmp = RADEON_DAC_FORCE_BLANK_OFF_EN | - RADEON_DAC_FORCE_DATA_EN; - - if (color) - tmp |= RADEON_DAC_FORCE_DATA_SEL_RGB; - else - tmp |= RADEON_DAC_FORCE_DATA_SEL_G; + RADEON_DAC_FORCE_DATA_EN | RADEON_DAC_FORCE_DATA_SEL_RGB; if (ASIC_IS_R300(rdev)) tmp |= (0x1b6 << RADEON_DAC_FORCE_DATA_SHIFT);