Re: [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@xxxxxxxxx>

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

 



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>

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux