lkml.org 
[lkml]   [2008]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
From
Date
On Tue, 2008-06-24 at 21:04 -0700, Linus Torvalds wrote:

> It's really irritating how we cannot extend on the printk strings without
> either having to throw out gcc warnings altogether. gcc has no extension
> mechanism to the built-in rules ;/
>
> The format warnings are too useful to drop entirely. I guess sparse could
> be taught to do them, and then we could drop the gcc support for them. But
> that would still limit coverage a _lot_.

We should probably start working on getting this fixed.

In networking, we've gone through various incarnations of print_mac()
which is similar to the sym() macro Paul proposed, and it turned out to
be undesirable because of the way it interacts with static inlines that
only optionally contain code at all, the print_mac() function call is
still emitted by the compiler. People experimented with marking it
__pure but that had other problems.

It would be nice to be able to say

u8 *eaddr;

printk(... %M ..., eaddr);

and get
03:45:67:89:ab:cd

out of it, which avoids both the large string/code you get when doing it
manually (printf("%2.x:...:%.2x", eaddr[0], ...) for which there are
macros) and the "function call in hotpath even when debugging is
disabled" problem I mentioned above.

johannes
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2008-06-25 17:05    [W:0.087 / U:1.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site