mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Roland McGrath <roland@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ptrace: checkpatch fixes
Date: Wed, 8 Apr 2009 21:57:54 +0200	[thread overview]
Message-ID: <200904082157.54134.borntraeger@de.ibm.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0904081007530.4583@localhost.localdomain>

Am Wednesday 08 April 2009 19:19:36 schrieb Linus Torvalds:
>   And some lines just end up long.  I think 100 characters may be a
>   more reasonable limit for "too long", but quite frankly, it depends on
>   the line.
> 
>   So I think 'checkpatch' is pure crap in this area, and I've told
>   people so before, and they keep telling me that it has relaxed it's
>   idiotic warnings, but that is apparently just a lie. ]
> 
> Oh well.  If I actually read perl, I could parse what the hell those
> 80-character rules are in checkpath.  It already has random "it's ok if
> X" stuff.  But it never seems to really have any "oh, but splitting is
> worse" logic. 

Isnt checkpatch just following what is written down in the Documentation folder? Maybe adopting the following part of CodingStyle and add more examples for good and bad would give the checkpatch authors a better idea about your intent.

--------- snip---------
                Chapter 2: Breaking long lines and strings

Coding style is all about readability and maintainability using commonly
available tools.

The limit on the length of lines is 80 columns and this is a strongly
preferred limit.

Statements longer than 80 columns will be broken into sensible chunks.
Descendants are always substantially shorter than the parent and are placed
substantially to the right. The same applies to function headers with a long
argument list. Long strings are as well broken into shorter strings. The
only exception to this is where exceeding 80 columns significantly increases
readability and does not hide information.

void fun(int a, int b, int c)
{
        if (condition)
                printk(KERN_WARNING "Warning this is a long printk with "
                                                "3 parameters a: %u b: %u "
                                                "c: %u \n", a, b, c);
        else
                next_statement;
}
----------snip---------


  reply	other threads:[~2009-04-08 19:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08  6:21 Roland McGrath
2009-04-08  7:26 ` Sergio Luis
2009-04-08 12:50   ` Roland McGrath
2009-04-08 20:49     ` Sergio Luis
2009-04-08 17:19 ` Linus Torvalds
2009-04-08 19:57   ` Christian Borntraeger [this message]
2009-04-08 20:44     ` Linus Torvalds
2009-04-09  3:04   ` Ingo Molnar
2009-04-09  8:46     ` Miles Bader
2009-04-09 15:00     ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200904082157.54134.borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome