Re: [PATCH 2/2] staging:android:fix line over 80 characters issuein binders.c this patch fixes line over 80 characters warning that wasfound using checkpatch.pl tool Signed-off-by:Anirudh Bhat<abhat38@gmail.com>

From: Calvin Walton
Date: Tue Apr 24 2012 - 21:12:29 EST


On Thu, 2012-04-19 at 09:22 +0100, David Howells wrote:
> anirudh bhat <abhat38@xxxxxxxxx> wrote:
>
> > - printk(KERN_ERR "binder: %d: binder_alloc_buf failed to "
> > - "map pages in userspace, no vma\n", proc->pid);
> > + printk(KERN_ERR "binder: %d: binder_alloc_buf failed to map pages in userspace, no vma\n",
> > + proc->pid);
>
> Are these the wrong way round? Surely these are introducing checkpatch
> warnings rather than curing them?
>
> If checkpatch is complaining about:
>
> printk(KERN_ERR "binder: %d: binder_alloc_buf failed to "
> "map pages in userspace, no vma\n", proc->pid);
>
> being a string split over multiple lines, then *checkpatch* needs to be fixed.

This check was added to checkpatch on purpose, with the intention of
allowing you to use e.g.
$ git grep 'failed to match pages'
to find out where in the kernel source the message came from. If the
string is split and wrapped, that doesn't work.

This is mentioned as a recommendation in Documentation/CodingStyle as
well:
> Statements longer than 80 columns will be broken into sensible chunks, unless
> exceeding 80 columns significantly increases readability and does not hide
> information. 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. However, never break user-visible strings such as
> printk messages, because that breaks the ability to grep for them.

--
Calvin Walton <calvin.walton@xxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/