From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shobhit Kumar Subject: Re: [PATCH 5/9] drm/i915: SHUTDOWN & Turn ON packets to be sent for both MIPI Ports in case of dual link Configuration Date: Thu, 25 Sep 2014 19:52:24 +0530 Message-ID: <54242520.1010306@linux.intel.com> References: <1411548418-26525-1-git-send-email-gaurav.k.singh@intel.com> <1411548418-26525-6-git-send-email-gaurav.k.singh@intel.com> <87a95pmkif.fsf@intel.com> <54241078.6040508@linux.intel.com> <87tx3vvmyx.fsf@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E0A889D79 for ; Thu, 25 Sep 2014 07:22:54 -0700 (PDT) In-Reply-To: <87tx3vvmyx.fsf@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Jani Nikula , Gaurav K Singh , intel-gfx Cc: Shobhit Kumar List-Id: intel-gfx@lists.freedesktop.org On Thursday 25 September 2014 07:09 PM, Jani Nikula wrote: > On Thu, 25 Sep 2014, Shobhit Kumar wrote: >> On Wednesday 24 September 2014 03:02 PM, Jani Nikula wrote: >>> On Wed, 24 Sep 2014, Gaurav K Singh wrote: >>>> + do { >>> >>> Please never use a do-while when a regular for loop will do. >> >> Hmm, ok but reasoning ? Point here is that anyway we have to do once for >> first port and do..while helps maintain that simple flow > > Okay, this is subjective. It's my opinion that for doing things N times > in C, the basic for (i = 0; i < N; i++) *is* the paradigm to use. A > sub-second glance at that, and you know what it does. Not so with do { > ... } while (--count > 0), particularly when the block has lots of > stuff. Well the do..while I felt makes it obvious that the first iteration has to be always done anyways and second is optional depeding on the panel and thats why I used it, > > So I'd go with something like: > > for (i = 0; i < intel_dsi->dual_link ? 2 : 1; i++) > > where it's immediately obvious that this stuff is done twice for dual > link. Makes sense, right? but the way you put across your for loop does make me feel that it makes the whole logic much more clear. Will do the change. Thanks. Regards Shobhit