From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Moore Date: Mon, 10 Feb 2014 11:16:38 +0100 Subject: [U-Boot] Question about Coding-Style In-Reply-To: <20140210105849.198999db@lilith> References: <11685.213.33.116.116.1391518218.squirrel@petermaier.org> <52F0F5C4.2010304@denx.de> <29703.213.33.116.113.1391525447.squirrel@petermaier.org> <52F10120.9040700@denx.de> <20140204150732.GC7049@bill-the-cat> <20140210105849.198999db@lilith> Message-ID: <52F8A706.7030103@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Albert, Le 10/02/2014 10:58, Albert ARIBAUD a ?crit : > Hi Tom, > > On Tue, 4 Feb 2014 10:07:32 -0500, Tom Rini wrote: > >> On Tue, Feb 04, 2014 at 04:02:56PM +0100, Stefano Babic wrote: >>> Hi Hannes, >>> >>> On 04/02/2014 15:50, Hannes Petermaier wrote: >> [snip] >>>> Another thing is linewrapping of output strings, to obey to the rules i >>>> have to format the string as following: >>>> >>>> if (i2c_probe(TPS65217_CHIP_PM)) { >>>> printf("PMIC chip (0x%02x) not present! skipping" \ >>>> "further configuration.\n", TPS65217_CHIP_PM); >>>> return; >>>> } >>>> >>>> But this makes it impossible to grep the code in case of an error. >>> You must combine a more complicate grep, maybe with the -A (after >>> context) option or using a regexp. However, this is not a reason to >>> break the rule. >> Strings are the reason to break the rule and we have checkpatch patched >> (mostly?) to not complain. It's even true in the kernel. > Hmm... Last time I checked, > > "abc" > "def" > > Is a valid C string, and does not require a backslash. Do I miss > something? Yes, you are of course correct: the result is the C string "abcdef" and the backslash in the original is superfluous. However a grep for "abcdef" in the source code won't match it :( This is why splitting strings like this is discouraged in the Linux kernel. Cheers, Chris --- Ce courrier ?lectronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active. http://www.avast.com