mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	R.E.Wolff@bitwizard.nl
Subject: Re: [PATCH] drivers/char/specialix.c: stop inlining largish static functions
Date: Wed, 9 Apr 2008 00:18:53 +0200	[thread overview]
Message-ID: <200804090018.53053.vda.linux@googlemail.com> (raw)
In-Reply-To: <47FBE5C3.1040105@gmail.com>

On Tuesday 08 April 2008 23:38, Jiri Slaby wrote:
> > drivers/char/specialix.c has unusually large number
> > of static inline functions - 22.
> > 
> > I looked through them. The file is positively inline-happy.
> > Inlines with udelay() calls. Inlines with complex loops.
> > Nested inlines. Rarely called inlines (e.g. with request_region
> > inside).
> > 
> > This patch removes "inline" from 15 static functions
> > (regardless of number of callsites - gcc nowadays auto-inlines
> > statics with one callsite).
> > 
> > Size difference for 32bit x86:
> >    text    data     bss     dec     hex filename
> >   21669     204    8780   30653    77bd linux-2.6-ALLYES/drivers/char/specialix.o
> >   18470     204    8780   27454    6b3e linux-2.6.inline-ALLYES/drivers/char/specialix.o
> > 
> > 
> > Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
> 
> -	static const char *badmagic =
> +	static const char badmagic[] =
>   		KERN_ERR "sx: Warning: bad specialix port magic number for device %s in %s\n";
> -	static const char *badinfo =
> +	static const char badinfo[] =
>   		KERN_ERR "sx: Warning: null specialix port for device %s in %s\n";
> 
> 
> BTW what's this good for? I mean, why we need this as a variable not directly as 
> a parameter?
> 
>   	if (!port) {
>   		printk(badinfo, name, routine);
>   		return 1;
>   	}
>   	if (port->magic != SPECIALIX_MAGIC) {
>   		printk(badmagic, name, routine);
>   		return 1;
>   	}

I am sure these strings can be used directly in printk,
there should be no size difference (sans gcc adding padding
to string arrays "just because").

I chose to make minimal change which only eliminates the waste
of having a pinter to these strings (char *msg = "xxx"
versus char msg[] = "xxx"), leaving more extensive editing
to someone who wants to attack specialix.c on the wider front.
--
vda

      parent reply	other threads:[~2008-04-08 22:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-08 10:44 Denys Vlasenko
2008-04-08 11:43 ` Rogier Wolff
2008-04-08 12:10   ` Alan Cox
2008-04-08 21:38 ` Jiri Slaby
2008-04-08 22:15   ` Rogier Wolff
2008-04-08 22:18   ` Denys Vlasenko [this message]

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=200804090018.53053.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.com \
    --cc=R.E.Wolff@bitwizard.nl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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

Powered by JetHome