lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081210125846.GC6772@localhost>
Date:	Wed, 10 Dec 2008 20:58:46 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	Laurent Pinchart <laurent.pinchart@...net.be>
Cc:	Oliver Neukum <oliver@...kum.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
Subject: Re: [PATCH] usb: make printk messges more searchable

On Wed, Dec 10, 2008 at 11:59:00AM +0200, Laurent Pinchart wrote:
> On Wednesday 10 December 2008, Oliver Neukum wrote:
> > Am Mittwoch, 10. Dezember 2008 10:42:17 schrieb Laurent Pinchart:
> > > Hi Wu,
> > >
> > > On Wednesday 10 December 2008, Wu Fengguang wrote:
> > > > Make USB printk messages long and straightforward.  One of these
> > > > decorated USB error messages cost me some smart efforts to locate.
> > >
> > > That would make the code break the 80 columns limit.
> > >
> > > From "Documentation/CodingStyle":
> > >
> > > "The limit on the length of lines is 80 columns and this is a strongly
> > > preferred limit."
> >
> > Too rigid an application is bad. The kernel must be greppable.
> 
> I've also been bitten by split strings when grepping kernel source code. A 
> cgrep that would unsplit strings before searching them would be nice :-)

Such printk will sure bite more people.  And it's amazing that the CodingStyle
document uses printk as an 80-column example:

 80 The limit on the length of lines is 80 columns and this is a strongly
 81 preferred limit.
 82 
 83 Statements longer than 80 columns will be broken into sensible chunks.
 84 Descendants are always substantially shorter than the parent and are placed
 85 substantially to the right. The same applies to function headers with a long
 86 argument list. Long strings are as well broken into shorter strings. The
 87 only exception to this is where exceeding 80 columns significantly increases
 88 readability and does not hide information.
 89 
 90 void fun(int a, int b, int c)
 91 {
 92         if (condition)
 93                 printk(KERN_WARNING "Warning this is a long printk with "
 94                                                 "3 parameters a: %u b: %u "
 95                                                 "c: %u \n", a, b, c);
 96         else
 97                 next_statement;
 98 }

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ