lkml.org 
[lkml]   [2004]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Stop printk printing non-printable chars
On Fri, 2004-06-18 21:53:55 +0100, matthew-lkml@newtoncomputing.co.uk <matthew-lkml@newtoncomputing.co.uk>
wrote in message <20040618205355.GA5286@newtoncomputing.co.uk>:

> The main problem seems to be in ACPI, but I don't see any reason for

Right.

> printk to even consider printing _any_ non-printable characters at all.

It's dandy if you pump out some data via serial link.

> It makes all characters out of the range 32..126 (except for newline)
> print as a '?'.

I don't see why that's needed. I'd say let's better fix ACPI to put
those strings as a hexdump or something like that.

> #include <linux/kernel.h>
> @@ -538,7 +540,11 @@
> }
> log_level_unknown = 0;
> }
> - emit_log_char(*p);
> + if (p[0] != '\n' && (p[0] < 32 || p[0] > 126)) {
> + emit_log_char('?');
> + } else {
> + emit_log_char(*p);
> + }
> if (*p == '\n')
> log_level_unknown = 1;
> }

So you're ripping off something that could be a nice feature and place
some slow path. By the way, why do you use 'p[0]' instead of '*p'?

MfG, JBG

--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.150 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site