lkml.org 
[lkml]   [2017]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: printk: what is going on with additional newlines?
On (09/17/17 19:45), Joe Perches wrote:
[..]
> > take a look at ACPI acpi_os_vprintf(). for instance.
>
> I've looked.

I don't get your point.

#define ACPI_MSG_ERROR KERN_ERR "ACPI Error: "
#define ACPI_MSG_EXCEPTION KERN_ERR "ACPI Exception: "
#define ACPI_MSG_WARNING KERN_WARNING "ACPI Warning: "
#define ACPI_MSG_INFO KERN_INFO "ACPI: "

so when we do

acpi_os_printf(ACPI_MSG_WARNING "%s: ", pathname);

we end up with

printk("%s", KERN_WARNING "ACPI Warning: %%pathname%%");

note how acpi_os_vprintf() calls printk_get_level() _on_ the
buffer is passes to

printk("%s", buffer)

because KERN_WARNING is part of the buffer, not the fmt.

there are also other examples that do similar things.


> Try git grep KERN_SOH.

what for?

-ss

\
 
 \ /
  Last update: 2017-09-18 04:56    [W:0.255 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site