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:	Sat, 6 Sep 2008 21:02:22 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@...ux-mips.org>
To:	Ingo Molnar <mingo@...e.hu>
cc:	Cyrill Gorcunov <gorcunov@...il.com>, hpa@...or.com,
	linux-kernel@...r.kernel.org, tglx@...utronix.de,
	yhlu.kernel@...il.com
Subject: Re: [patch 3/3] x86: io-apic - code style cleaning for setup_IO_APIC_irqs

On Sat, 6 Sep 2008, Ingo Molnar wrote:

> >  Honestly, this one should probably use sprintf() or suchlike to avoid the
> > mess of printk() calls building a line of output from pieces.  It's quite
> > easy to calculate here what the maximum size of the buffer required could
> > be and automatic arrays can have variable size, so no need for the hassle
> > of heap management.  Calls to printk() without a trailing newline should
> > be avoided where possible as it messes up logging priority if a message
> > pops up from an interrupt inbetween.
> 
> hm, is it worth the trouble? This is during very early init.

 But is it really a trouble?  With an auto array the additional code is
minuscule -- mostly printk() calls replaced with sprintf() plus a variable
or two to maintain a pointer to the buffer which will go into registers
anyway.  Plus a pr_info("%s", buffer) or suchlike at the end.  I know 
laziness is a virtue, but you have to draw a line somewhere. ;)

 The benefit, apart from what I wrote above, is less chance of propagating
bad style to newcomers with each piece of such old code removed.

  Maciej
--
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