Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4073714ybb; Mon, 6 Apr 2020 23:40:56 -0700 (PDT) X-Google-Smtp-Source: APiQypIYGUr3Z+sXhc5sN2HMMqUsAmDrQMfZMljZpw51IjID0Mae9u6X1k+DRw26END09siM6AD6 X-Received: by 2002:aca:3284:: with SMTP id y126mr536983oiy.175.1586241656325; Mon, 06 Apr 2020 23:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586241656; cv=none; d=google.com; s=arc-20160816; b=msEAu8mPO8/AD7TqoIR6mTZVNFUckWgmhMqiyUOcdYFRVAaO0SjDJQz/Ie393ZdL+U XXjFWYMa1EqJyybxEHfKL1kER0Mu81zi62EDDywlQfzjTIglg6JPGeAuW6ZCiSWzTWq1 bHrJ1+tJUcODk0b4x6T55JTbGMowIeJ3SQ/rEgMvpn1smKttYvdXcDjjC3rg/IVpfVP1 fER1fCBw7tiTH0GSHkDW1gC47F7hWithdDUaa37dG+k/5vUuzCFGgJaE7JMKSY25f5L+ aJVMnwT5amYxvJzL+t88Zs1wgz2hWLO0UkYoHHu3ZzZFKUHgwJ3ohcdohGlmhDfBqppD jGaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=ggW3/YoRYN9wyC4HbFJFfR8leZrGfYQ0LZ6TkDYeZ94=; b=ogJj5kbbTF6eEev+Zxe+wgdaxSOnU2YGLKPdkuYlJGqdcD/7FLxSdUy151dE6ABYv0 KbT30PuCP6F68da1Gusvq7yabwAQfGecF4jl9Lm7NN3WUVOjljq1lgxLYKUuNQ7Eeqwr VcSYbp78BVkeX49bOguq2eF1vlZfiWKXdwWRW1USusXahCC6QVK8xvp/zGrpAKUlwPUL jvCTZ4JiFD9N8rxJ6m6hIIgHCOFNvkalEwzYvnxj77ymy/CHr8uaEKYqepnbd0lJ1evn rrIuovuMr9xEiWxKSc1qOaE+XWorhHG/pn1P3LTW+CnDz5MvEEm3aHmZkz4ms87g1Qho mhSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si944631ots.325.2020.04.06.23.40.45; Mon, 06 Apr 2020 23:40:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727191AbgDGGkL (ORCPT + 99 others); Tue, 7 Apr 2020 02:40:11 -0400 Received: from mga05.intel.com ([192.55.52.43]:38260 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbgDGGkK (ORCPT ); Tue, 7 Apr 2020 02:40:10 -0400 IronPort-SDR: jIpmVSpgu6111lUugJjIWRFMcipDLQ/TWo+c0LDl7+fYTiw6jN50MuYBQegl+RTcrfnwrHMh9M Ika4p2y50pKQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2020 23:40:10 -0700 IronPort-SDR: i4PRgE8ZRe2DLJdUwFjQBQ0GuvfnsLNttg/JS+fksyonvkFwCotbJR7m676bfJaOoDNA6wliJ9 p7Pzye2D159Q== X-IronPort-AV: E=Sophos;i="5.72,353,1580803200"; d="scan'208";a="424640672" Received: from vogtstef-mobl3.ger.corp.intel.com (HELO localhost) ([10.249.40.153]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2020 23:40:05 -0700 From: Jani Nikula To: Lyude Paul , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Sean Paul , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , Ville =?utf-8?B?U3lyasOkbMOk?= , Imre Deak , Maarten Lankhorst , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] drm/i915/dp_mst: Cast intel_connector->port as drm_dp_mst_port In-Reply-To: <20200406200646.1263435-1-lyude@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20200406200646.1263435-1-lyude@redhat.com> Date: Tue, 07 Apr 2020 09:40:02 +0300 Message-ID: <87eeszlry5.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 06 Apr 2020, Lyude Paul wrote: > The only reason for having this cast as void * before was because we > originally needed to use drm_dp_mst_get_port_validated() and friends in > order to (attempt to) safely access MST ports. However, we've since > improved how reference counting works with ports and mstbs such that we > can now rely on drm_dp_mst_port structs remaining in memory for as long > as the driver needs. This means we don't really need to cast this as > void* anymore, and can just access the struct directly. To/from void* does not need a cast in C anyway. ;) Acked-by: Jani Nikula > > We'll also need this for the next commit, so that we can remove > drm_dp_mst_port_has_audio(). > > Signed-off-by: Lyude Paul > Reviewed-by: Sean Paul > --- > drivers/gpu/drm/i915/display/intel_display_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h > index 5a0adf14ebef..0ddc98afe252 100644 > --- a/drivers/gpu/drm/i915/display/intel_display_types.h > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h > @@ -438,7 +438,7 @@ struct intel_connector { > state of connector->polled in case hotplug storm detection changes it */ > u8 polled; > > - void *port; /* store this opaque as its illegal to dereference it */ > + struct drm_dp_mst_port *port; > > struct intel_dp *mst_port; -- Jani Nikula, Intel Open Source Graphics Center