From patchwork Thu Oct 5 21:38:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 9988035 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 161CF60247 for ; Thu, 5 Oct 2017 21:39:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0617928CEA for ; Thu, 5 Oct 2017 21:39:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECE3C28D48; Thu, 5 Oct 2017 21:39:07 +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=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 9C55628CEA for ; Thu, 5 Oct 2017 21:39:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8778D6E874; Thu, 5 Oct 2017 21:39:05 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 509CF6E874 for ; Thu, 5 Oct 2017 21:39:04 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Oct 2017 14:39:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,482,1500966000"; d="scan'208";a="907183330" Received: from przanoni-mobl.amr.corp.intel.com ([10.254.176.144]) by FMSMGA003.fm.intel.com with ESMTP; 05 Oct 2017 14:39:01 -0700 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 5 Oct 2017 18:38:41 -0300 Message-Id: <20171005213842.11423-1-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.9.5 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 1/2] drm/i915: avoid unnecessary call to intel_hpd_pin_to_port 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: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Don't call it when we can do like the other functions and just look at port->port. Also rename the intel_digital_port variable to make it look like the other functions. My main goal here is to prevent the copy-pasters from propagating the call to other parts of the code. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_dp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index ca48bce..6fb90fa 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4614,14 +4614,11 @@ static bool bdw_digital_port_connected(struct drm_i915_private *dev_priv, } static bool bxt_digital_port_connected(struct drm_i915_private *dev_priv, - struct intel_digital_port *intel_dig_port) + struct intel_digital_port *port) { - struct intel_encoder *intel_encoder = &intel_dig_port->base; - enum port port; u32 bit; - port = intel_hpd_pin_to_port(intel_encoder->hpd_pin); - switch (port) { + switch (port->port) { case PORT_A: bit = BXT_DE_PORT_HP_DDIA; break; @@ -4632,7 +4629,7 @@ static bool bxt_digital_port_connected(struct drm_i915_private *dev_priv, bit = BXT_DE_PORT_HP_DDIC; break; default: - MISSING_CASE(port); + MISSING_CASE(port->port); return false; }