[PATCH v4 01/16] drm: exynos/dp: fix code style

Yakir Yang ykk at rock-chips.com
Sat Sep 5 18:33:45 PDT 2015


Hi Joe,

在 09/03/2015 01:57 PM, Joe Perches 写道:
> On Thu, 2015-09-03 at 13:33 +0800, Yakir Yang wrote:
> []
>>>>>> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c
> []
>>>>>> @@ -155,24 +156,22 @@ static int exynos_dp_read_edid(struct
>>>>>> exynos_dp_device *dp)
>>>>>>             }
>>>>>>               exynos_dp_read_byte_from_dpcd(dp, DP_TEST_REQUEST,
>>>>>> -                    &test_vector);
>>>>>> +                          &test_vector);
>>>>>>             if (test_vector & DP_TEST_LINK_EDID_READ) {
>>>>>> -            exynos_dp_write_byte_to_dpcd(dp,
>>>>>> -                DP_TEST_EDID_CHECKSUM,
>>>>>> +            exynos_dp_write_byte_to_dpcd(
>>>>>> +                dp, DP_TEST_EDID_CHECKSUM,
>>>>>>                     edid[EDID_BLOCK_LENGTH + EDID_CHECKSUM]);
>>>>>> -            exynos_dp_write_byte_to_dpcd(dp,
>>>>>> -                DP_TEST_RESPONSE,
>>>>>> +            exynos_dp_write_byte_to_dpcd(
>>>>>> +                dp, DP_TEST_RESPONSE,
>>>>>>                     DP_TEST_EDID_CHECKSUM_WRITE);
>>>>> To me, missing argument after opening parenthesis, looks worse. I would
>>>>> prefer:
>>>>>
>>>>>               exynos_dp_write_byte_to_dpcd(dp,
>>>>>
>>>>> Why you moved the 'dp' argument to new line?
>>>> Hmm... Just like style tool indicate, no more warning after
>>>> that change.
>>>>
>>>> For now, I would like to follow the original style, just improved
>>>> some obvious style problem.  :-)
>>> What was the checkpatch warning that said 'dp' has to move to new line?
>>> I tried this and I don't see it.
>> checkpatch haven't remind me that put dp to new line would fix
>> this warning, this just come from my experiments. And I works,
>> no more warnings from checkpatch, so I toke this style.
> Checkpatch isn't a great arbiter of style.
> It's just a brainless tool.
>
> Always use your instead of anything brainless.
>
> If it were code I was writing, I'd ignore 80 columns warnings
> where appropriate.
>
> These are long function names and long macro defines, so it's
> inappropriate to use 80 columns as a guiding style.
>
> I'd write:
>
> 		exynos_dp_read_byte_from_dpcd(dp, DP_TEST_REQUEST, &test_vector);
> 		if (test_vector & DP_TEST_LINK_EDID_READ) {
> 			exynos_dp_write_byte_to_dpcd(dp, DP_TEST_EDID_CHECKSUM,
> 						     edid[EDID_BLOCK_LENGTH + EDID_CHECKSUM]);
> 			exynos_dp_write_byte_to_dpcd(dp, DP_TEST_RESPONSE,
> 						     DP_TEST_EDID_CHECKSUM_WRITE);
> 		}
>

So... just ignore the 80 columns warnings. Actually I prefer to
keep the original style in this case.

Thanks,
- Yakir
]
>
>
>





More information about the linux-arm-kernel mailing list