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

Calvin Walton calvin.walton at kepstin.ca
Wed Apr 25 01:11:41 UTC 2012


On Thu, 2012-04-19 at 09:22 +0100, David Howells wrote:
> anirudh bhat <abhat38 at gmail.com> 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 at kepstin.ca>




More information about the devel mailing list