lkml.org 
[lkml]   [2002]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] printk prefix cleanups.
Zwane Mwaikambo wrote:
>
> Here is a simple patch which reduces resultant binary size by 1.2k for
> this particular module (opl3sa2). Perhaps we should consider adding this
> on the janitor TODO list for cleaning up other printks.
>
> Regards,
> Zwane Mwaikambo
>
> --- linux-2.4.18-pre8-zm1/drivers/sound/opl3sa2.c.orig Mon Feb 11 02:25:50 2002
> +++ linux-2.4.18-pre8-zm1/drivers/sound/opl3sa2.c Mon Feb 11 02:40:59 2002
> @@ -71,6 +71,7 @@
> #include "mpu401.h"
>
> #define OPL3SA2_MODULE_NAME "opl3sa2"
> +#define OPL3SA2_PFX OPL3SA2_MODULE_NAME ": "
>
> /* Useful control port indexes: */
> #define OPL3SA2_PM 0x01
> @@ -616,7 +617,7 @@
> AD1848_REROUTE(SOUND_MIXER_LINE3, SOUND_MIXER_LINE);
> }
> else {
> - printk(KERN_ERR "opl3sa2: MSS mixer not installed?\n");
> + printk(KERN_ERR OPL3SA2_PFX "MSS mixer not installed?\n");
> }
> }
> }
> @@ -639,7 +640,7 @@
> * Try and allocate our I/O port range.
> */
> if(!request_region(hw_config->io_base, 2, OPL3SA2_MODULE_NAME)) {
> - printk(KERN_ERR "opl3sa2: Control I/O port %#x not free\n",
> + printk(KERN_ERR OPL3SA2_PFX "Control I/O port %#x not free\n",

This reduces -binary- size, as shown by /usr/bin/size? Strings should
be merged, which makes this strange...

Anyway, I might be able to claim to be the first user of 'PFX'. You
will note that it does not have a prefix... on purpose. The idea is to
save typing a repetitive and changing-for-each-driver string.

Just use 'PFX' in the source code, like you find in other drivers.

Jeff




--
Jeff Garzik | "I went through my candy like hot oatmeal
Building 1024 | through an internally-buttered weasel."
MandrakeSoft | - goats.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.080 / U:11.156 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site