From: Joe Perches Subject: Re: [PATCH] efi: Add newline to cper DIMM location messages Date: Mon, 27 Jan 2014 16:44:00 -0800 Message-ID: <1390869840.20150.69.camel@joe-AO722> References: <52e6a8d812916d47b@agluck-desk.sc.intel.com> <3908561D78D1C84285E8C5FCA982C28F31DBA1E0@ORSMSX106.amr.corp.intel.com> <1390863051.20150.55.camel@joe-AO722> <3908561D78D1C84285E8C5FCA982C28F31DBA6CB@ORSMSX106.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F31DBA6CB-P5GAC/sN6hlZtRGVdHMbwrfspsVTdybXVpNB7YpNyf8@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Luck, Tony" Cc: Linus Torvalds , Kay Sievers , Andrew Morton , "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "Chen, Gong" , "Fleming, Matt" , Yoshihiro YUNOMAE List-Id: linux-efi@vger.kernel.org On Tue, 2014-01-28 at 00:26 +0000, Luck, Tony wrote: > > But that actually argues *more* for moving to a world where that > > (common, but also often-forgotten) final '\n' at the end should be > > de-emphasized. So I don't think it would be at all wrong to expect > > that > > > > printk("Line A"); > > printk("Line B"); > > > > should print two lines. We very much had that KERN_CONT to encode the > > *exception* to this, for the (not very common) cases where we end up > > listing multiple things on one line. Depends on how old the code in question is. KERN_CONT was introduced in Oct 2007 (commit 4749252776) and everything older than that actually did have the intention of continuing a previous line or was a defect. KERN_DEFAULT was June 2009 (commit e28d7137041) and that allowed printks to start with any KERN_ but KERN_CONT and actually start on a new line too even if the preceding printk did not end in '\n'. There are very few uses overall of KERN_DEFAULT. I think KERN_DEFAULT should be removed actually. All the uses might be better with a specific level. > Of course if people *really* want things on the same line, they usually end > up using sprintf() to save the individual pieces to some buffer and the dump > that out using one printk() call No, actually, they don't. There's probably much more code that uses KERN_CONT or no KERN_ level where it's intended that the printks be merged than uses of intermediate buffers. There are many uses of %pV that effectively serve as a mechanism to avoid using multiple printks though. > ... because KERN_CONT isn't much help when > some other code comes along and drops its own output in the middle of > what you were trying to pretty print. Exactly true. I've submitted quite a few patches that avoid multiple printks by either using %pV or coalescing the separate printks into a single printk. There are _lots_ more that could be done. Maybe adding a patch similar to what Linus proposes would cause a lot more of these changes to be done quicker.