lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 25 Aug 2009 17:39:08 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Anirban Sinha <ASinha@...gmasystems.com>
cc:	linux-kernel@...r.kernel.org
Subject: RE: [PATCH] console_print: change the function api to make it have
 printk style interface



On Tue, 25 Aug 2009, Anirban Sinha wrote:
> 
> Ah! Of course you are correct! Can we simply have a macro instead of a
> full blown function instead? If that is not acceptable, I will think of
> something else to get around it.

A macro is what others are generally doing.

I'd suggest looking at "dev_printk()" as an example. Sure, it basically 
requires that the first argument be a string constant (so that the 
automatic concatenations of string constants in C does its job), so it's 
not a _generic_ solution, but it's a very powerful and simple one.

In other words, you'll likely have to change a few existing

	console_print(data);

to

	console_print("%s", data);

to make things work, but hey, not a big deal.

That said, quite frankly, I suspect an even better solution would be to 
just remove the whole 'console_print()' function entirely, and just make 
people use 'printk()' or 'dev_printk()' instead. The only real valid 
reason for that thing existing in the first place is likely the 
_assembler_ interface of doing a printout of an ASCII string (see 
arch/ia64/kernel/head.S).

The other uses of 'console_print()' seem totally pointless, really. It's a 
stupid legacy interface that shouldn't exist, I'm afraid.

		Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ