[Intel-gfx] [PATCH 5/9] drm/i915: SHUTDOWN & Turn ON packets to be sent for both MIPI Ports in case of dual link Configuration

Shobhit Kumar shobhit.kumar at linux.intel.com
Thu Sep 25 16:22:24 CEST 2014


On Thursday 25 September 2014 07:09 PM, Jani Nikula wrote:
> On Thu, 25 Sep 2014, Shobhit Kumar <shobhit.kumar at linux.intel.com> wrote:
>> On Wednesday 24 September 2014 03:02 PM, Jani Nikula wrote:
>>> On Wed, 24 Sep 2014, Gaurav K Singh <gaurav.k.singh at intel.com> 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



More information about the Intel-gfx mailing list