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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 25 Sep 2014, Shobhit Kumar <shobhit.kumar@xxxxxxxxxxxxxxx> wrote:
> On Wednesday 24 September 2014 03:02 PM, Jani Nikula wrote:
>> On Wed, 24 Sep 2014, Gaurav K Singh <gaurav.k.singh@xxxxxxxxx> 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.

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?

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux