From: Damien Lespiau Subject: Re: [PATCH 2/2] drm/i915: Change Mipi register definitions Date: Mon, 19 May 2014 17:10:50 +0100 Message-ID: <20140519161050.GB19476@strange.amr.corp.intel.com> References: <1400513044-7968-1-git-send-email-shashank.sharma@intel.com> <1400513044-7968-3-git-send-email-shashank.sharma@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B73D6E066 for ; Mon, 19 May 2014 09:11:19 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1400513044-7968-3-git-send-email-shashank.sharma@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Shashank Sharma Cc: jani.nikula@intel.com, intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, May 19, 2014 at 08:54:04PM +0530, Shashank Sharma wrote: > Re-define MIPI register definitions in such a way that most of > the existing DSI code can be re-used for future platforms. Register > definitions are re-written using MMIO offset variable, so that without > changing the existing sequence, same code can be generically applied. > > Signed-off-by: Shashank Sharma Two little things: * You changed the _PIPE() macro to something with a jump, can we please not introduce branches here? might as well keep the _PIPE() macro, even if _TRANSCODER() would be slightly better (but strickly equivalent * You've cut everything to be < 80 chars. I really think that's one of the cases where it's worse, ie: #define _MIPIB_DSI_FUNC_PRG (dev_priv->mipi_mmio_base + \ 0xb80c) #define MIPI_DSI_FUNC_PRG(check) (!check ? \ _MIPIA_DSI_FUNC_PRG : _MIPIB_DSI_FUNC_PRG) Vs #define _MIPIB_DSI_FUNC_PRG (dev_priv->mipi_mmio_base + 0xb80c) #define MIPI_DSI_FUNC_PRG(pipe) _PIPE(pipe, _MIPIA_DSI_FUNC_PRG, _MIPIB_DSI_FUNC_PRG) Can we not do that? -- Damien