From patchwork Mon May 15 22:00:28 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: 9728525 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 AA66060386 for ; Tue, 16 May 2017 08:19:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9930B285F9 for ; Tue, 16 May 2017 08:19:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DC60289A7; Tue, 16 May 2017 08:19:27 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable 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 197C1285F9 for ; Tue, 16 May 2017 08:19:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B3E546E2C3; Tue, 16 May 2017 08:19:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: delayed 1502 seconds by postgrey-1.35 at gabe; Mon, 15 May 2017 22:46:51 UTC Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [192.185.147.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id 58B0889F73 for ; Mon, 15 May 2017 22:46:51 +0000 (UTC) Received: from cm5.websitewelcome.com (cm5.websitewelcome.com [108.167.139.22]) by gateway30.websitewelcome.com (Postfix) with ESMTP id D26571AB46 for ; Mon, 15 May 2017 17:00:29 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cm5.websitewelcome.com with id Lm0U1v00V0V9LXg01m0VfS; Mon, 15 May 2017 17:00:29 -0500 Received: from [189.219.177.89] (port=52606 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1dAO2W-00034C-Lq; Mon, 15 May 2017 17:00:28 -0500 Date: Mon, 15 May 2017 17:00:28 -0500 From: "Gustavo A. R. Silva" To: Daniel Vetter , Jani Nikula , David Airlie Message-ID: <20170515220028.GA15149@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170515215605.GA14963@embeddedgus> 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.219.177.89 X-Exim-ID: 1dAO2W-00034C-Lq X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.219.177.89]:52606 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 4 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Mailman-Approved-At: Tue, 16 May 2017 08:19:26 +0000 Cc: intel-gfx@lists.freedesktop.org, "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 2/2] gpu: drm: i915: compress logic into one line X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Simplify logic to avoid unnecessary variable declaration and assignment. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/intel_display.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b13b53b..ca6479a 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9565,7 +9565,6 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc, { struct drm_device *dev = crtc->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); - struct intel_shared_dpll *pll; const struct intel_limit *limit; int refclk = 120000; @@ -9609,8 +9608,7 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc, ironlake_compute_dpll(crtc, crtc_state, NULL); - pll = intel_get_shared_dpll(crtc, crtc_state, NULL); - if (pll == NULL) { + if (!intel_get_shared_dpll(crtc, crtc_state, NULL)) { DRM_DEBUG_DRIVER("failed to find PLL for pipe %c\n", pipe_name(crtc->pipe)); return -EINVAL;