From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 2/8] drm/i915: Always use INTEL_INFO() to access the device_info structure Date: Thu, 12 Dec 2013 20:47:48 +0200 Message-ID: <20131212184748.GI10036@intel.com> References: <1386859003-17246-1-git-send-email-damien.lespiau@intel.com> <1386859003-17246-3-git-send-email-damien.lespiau@intel.com> <20131212165821.GH6195@nuc-i3427.alporthouse.com> <20131212170518.GC14545@strange.amr.corp.intel.com> <20131212172308.GI6195@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id BA85DFAC27 for ; Thu, 12 Dec 2013 10:48:11 -0800 (PST) Content-Disposition: inline In-Reply-To: <20131212172308.GI6195@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Chris Wilson , Damien Lespiau , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Dec 12, 2013 at 05:23:08PM +0000, Chris Wilson wrote: > On Thu, Dec 12, 2013 at 05:05:18PM +0000, Damien Lespiau wrote: > > On Thu, Dec 12, 2013 at 04:58:21PM +0000, Chris Wilson wrote: > > > On Thu, Dec 12, 2013 at 02:36:37PM +0000, Damien Lespiau wrote: > > > > If we make sure that all the dev_priv->info usages are wrapped by > > > > INTEL_INFO(), we can easily modify the ->info field to be structure= and > > > > not a pointer while keeping the const protection in the INTEL_INFO() > > > > macro. > > > = > > > Yuck. > > = > > Would Jani's suggestion to transmogrify INTEL_INFO() into a function > > make you happier? Or is it the back and forth from *dev_priv to *dev > > to dev_priv->info that is of utmost disgust? > = > Ultimately, I'd like to see the pointer dance die. But in the meantime, > I'd like to see the macro die, dev_priv->info is far less scary than > INTEL_INFO(dev_priv->dev)->info, even to_i915(dev)->info is more > pleasant to read. I guess another option would be to make keep the dev_priv.info as a const struct, and just explicitly cast the const away when modifying the struct. -- = Ville Syrj=E4l=E4 Intel OTC