From: Damien Lespiau Subject: Re: [PATCH v2] drm/i915: Rename defines for selection of ddi buffer translation slot Date: Wed, 27 Aug 2014 12:26:28 +0100 Message-ID: <20140827112628.GB2292@strange.ger.corp.intel.com> References: <1407500245-11436-1-git-send-email-sonika.jindal@intel.com> <20140808123617.GB2751@strange.ger.corp.intel.com> <20140827111613.GQ4193@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 33BBE6E322 for ; Wed, 27 Aug 2014 04:26:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140827111613.GQ4193@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Aug 27, 2014 at 02:16:13PM +0300, Ville Syrj=E4l=E4 wrote: > On Fri, Aug 08, 2014 at 01:36:17PM +0100, Damien Lespiau wrote: > > On Fri, Aug 08, 2014 at 05:47:25PM +0530, sonika.jindal@intel.com wrote: > > > /* Start the training iterating through available voltages and emph= asis, > > > * testing each value twice. */ > > > - for (i =3D 0; i < ARRAY_SIZE(hsw_ddi_buf_ctl_values) * 2; i++) { > > > + for (i =3D 0; i < ARRAY_SIZE(hsw_ddi_translations_fdi); i++) { > > = > > This is correct but obsfucated. You're actually doing > > ARRAY_SIZE(hsw_ddi_translations_fdi) / 2 * 2 and we might as well give > > the ARRAY_SIZE(hsw_ddi_translations_fdi) / 2 a proper name like I > > suggested. > = > I've been wondering why we don't have something like: > = > struct ddi_buf_trans { > u32 deemp; > u32 vswing; > } > = > and use that instead of having the magic /2 appear in places. Yes, this is something we've discussed in a separate thread with Jani as well and that'd be indeed even better. Someone wants to sign up for that? -- = Damien