Re: [PATCH for-next v2] RDMA/cma: Replace RMW with atomic bit-ops

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

 




> On 22 Jun 2021, at 08:16, Leon Romanovsky <leon@xxxxxxxxxx> wrote:
> 
> On Mon, Jun 21, 2021 at 03:55:40PM +0000, Haakon Bugge wrote:
>> 
>> 
>>> On 21 Jun 2021, at 17:12, Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:
>>> 
>>> On Mon, Jun 21, 2021 at 02:58:46PM +0000, Haakon Bugge wrote:
>>>> 
>>>> 
>>>>> On 21 Jun 2021, at 16:37, Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:
>>>>> 
>>>>> On Mon, Jun 21, 2021 at 10:46:26AM +0000, Haakon Bugge wrote:
>>>>> 
>>>>>>>> You're running an old checkpatch. Since commit bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column warning"), the default line-length is 100. As Linus states in:
>>>>>>>> 
>>>>>>>> https://lkml.org/lkml/2009/12/17/229
>>>>>>>> 
>>>>>>>> "... But 80 characters is causing too many idiotic changes."
>>>>>>> 
>>>>>>> I'm aware of that thread, but RDMA subsystem continues to use 80 symbols limit.
>>>>>> 
>>>>>> I wasn't aware. Where is that documented? Further, it must be a
>>>>>> limit that is not enforced. Of the last 100 commits in
>>>>>> drivers/infiniband, there are 630 lines longer than 80.
>>>>> 
>>>>> Linus said stick to 80 but use your best judgement if going past
>>>>> 
>>>>> It was not a blanket allowance to needless long lines all over the
>>>>> place.
>>>> 
>>>> That is not how I interpreted him:
>>> 
>>> There was a much newer thread on this from Linus, 2009 is really old
>> 
>> Yes, from last year, lkml.org/lkml/2020/5/29/1038
>> 
>> <quote>
>> Excessive line breaks are BAD. They cause real and every-day problems.
>> 
>> They cause problems for things like "grep" both in the patterns and in
>> the output, since grep (and a lot of other very basic unix utilities)
>> is fundamentally line-based.
>> 
>> So the fact is, many of us have long long since skipped the whole
>> "80-column terminal" model, for the same reason that we have many more
>> lines than 25 lines visible at a time.
>> 
>> And honestly, I don't want to see patches that make the kernel reading
>> experience worse for me and likely for the vast majority of people,
>> based on the argument that some odd people have small terminal
>> windows.
>> </quote>
>> 
>> Occasionally enforcing 80-chars line lengths in the RDMA subsystem seems like a strange policy to me :-)
> 
> I prefer to be strict here. We are submitting patches to different
> subsystems with different reviewers.

Indeed, a fair point. But there are plenty RDMA subsystem only commits with > 80 chars and other warnings, e.g., 

c80a0c52d85c ("RDMA/cma: Add missing error handling of listen_id")

But read me correct. I am probably one of the few here reading from left to right, and interprets c-code that way better than code having excessive line breaks.

Having:
	if (expression_a && expression_b) {
become:
	if (expression_a &&
	    expression_b) {

because the former is let's say 90 chars long, clearly reduces readability in my head. After all, the coding style also says:

<quote>
The coding style document also should not be read as an absolute law which
can never be transgressed.  If there is a good reason to go against the
style (a line which becomes far less readable if split to fit within the
80-column limit, for example), just do it.
</quote>

So, I'll end this here, just summing up my arguments: We have Linus' blessing for longer lines, checkpatch defaults to 100, readability gets better, and coding style allows exception from the 80 chars rule.


Thxs, Håkon


> 
> "This adds a few pointles > 80 char lines."
> https://lore.kernel.org/linux-rdma/20200907072921.GC19875@xxxxxx/
> 
>> 
>> 
>> Thxs, Håkon
>> 
>> 
>>> 
>>> Jason





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux