The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Zwane Mwaikambo <zwane@linux.realnet.co.sz>
Cc: Arnaldo Carvalho de Melo <acme@conectiva.com.br>,
	Kernel Janitors <kernel-janitor-discuss@lists.sourceforge.net>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] printk prefix cleanups.
Date: Tue, 12 Feb 2002 01:46:59 -0500	[thread overview]
Message-ID: <3C68BA63.E30DDF51@mandrakesoft.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0202120823200.27768-100000@netfinity.realnet.co.sz>

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

  reply	other threads:[~2002-02-12  6:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-12  6:26 [PATCH] printk prefix cleanups Zwane Mwaikambo
2002-02-12  6:46 ` Jeff Garzik [this message]
2002-02-12  9:50 ` Horst von Brand
     [not found] <mailman.1013495822.30629.linux-kernel2news@redhat.com>
2002-02-12  7:18 ` Pete Zaitcev
2002-02-12  7:26   ` Zwane Mwaikambo
2002-02-12  7:37     ` Jeff Garzik
2002-02-12  7:46       ` Zwane Mwaikambo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C68BA63.E30DDF51@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=acme@conectiva.com.br \
    --cc=kernel-janitor-discuss@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zwane@linux.realnet.co.sz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox