From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: Pavel Roskin <proski@gnu.org>,
Stefan Haberland <stefan.haberland@de.ibm.com>,
Jan Kara <jack@suse.cz>,
linux-cachefs@redhat.com, Mike Snitzer <snitzer@redhat.com>,
Neil Brown <neilb@suse.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jens Axboe <jens.axboe@oracle.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
"James E . J . Bottomley" <jejb@parisc-linux.org>,
ibm-acpi-devel@lists.sourceforge.net, Chr,
Julia Lawall <julia@diku.dk>, "H . Peter Anvin" <hpa@zytor.com>,
Daire Byrne <Daire.Byrne@framestore.com>,
Alasdair G Kergon <agk@redhat.com>,
Greg Banks <gnb@melbourne.sgi.com>,
Stefan Weinhuber <wein@de.ibm.com>,
Eric Sandeen <sandeen@redhat.com>, Adam Belay <abelay@mit.edu>,
netfilter-devel@vger.kernel.org, Helge Deller <deller@gmx.de>,
x86@kernel.org, James Morris <jmorris@namei.org>,
Takashi Iwai <tiwai@suse.de>, Ingo Molnar <mingo@redhat.com>,
Alan Cox <alan@l
Subject: Re: [dm-devel] [PATCH v4 00/12] introduce skip_spaces(), reducing code size plus some clean-ups
Date: Sun, 08 Nov 2009 10:05:03 -0600 [thread overview]
Message-ID: <1257696303.4184.8.camel@mulgrave.site> (raw)
In-Reply-To: <cover.1257602781.git.andre.goddard@gmail.com>
On Sat, 2009-11-07 at 13:16 -0200, André Goddard Rosa wrote:
> This patch reduces lib.a code size by 173 bytes on my Core 2 with gcc 4.4.1
> even considering that it exports a newly defined function skip_spaces()
> to drivers:
> text data bss dec hex filename
> 64867 840 592 66299 102fb (TOTALS-lib.a-before)
> 64954 584 588 66126 1024e (TOTALS-lib.a-after)
> and implements some code tidy up.
>
> Besides reducing lib.a size, it converts many in-tree drivers to use the
> newly defined function, which makes another small reduction on kernel size
> overall when those drivers are used.
Before we embark on something as massive as this, could we take a step
back. I agree that if I were coming up with the strstip() interface
today I probably wouldn't have given it two overloaded uses.
However, I think the function, in spite of this minor issue, is very
usable. I still don't understand why people thought adding a
__must_check, which is what damaged one of the overloaded uses, is a
good idea.
Assuming there's a good answer to the above:
> + * skip_spaces - Removes leading whitespace from @s.
> + * @s: The string to be stripped.
> + *
> + * Returns a pointer to the first non-whitespace character in @s.
> + */
> +const char *skip_spaces(const char *str)
I don't think const return is a good idea because most functions will be
manipulating the string and using pointers that won't be const, so this
will generate a ton of 'initialization discards qualifiers from pointer
target type' ... so that leads to the question of whether this patch
series was actually compiled ...
James
next parent reply other threads:[~2009-11-08 16:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1257602781.git.andre.goddard@gmail.com>
2009-11-08 16:05 ` James Bottomley [this message]
2009-11-08 16:52 ` [dm-devel] [PATCH v4 00/12] introduce skip_spaces(), reducing code size plus some clean-ups André Goddard Rosa
[not found] ` <c7d3b02b5e28eaa54a5360d57dfd177c44320187.1257602781.git.andre.goddard@gmail.com>
2009-11-08 16:50 ` [PATCH v4 10/12] string: factorize skip_spaces and export it to be generally available Alan Cox
[not found] ` <7d5883637aa976b54e944998f635d47a41618a75.1257602781.git.andre.goddard@gmail.com>
2009-11-08 18:47 ` [PATCH v4 12/12] tree-wide: convert open calls to remove spaces to skip_spaces() lib function Theodore Tso
2009-11-08 20:23 ` Julia Lawall
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=1257696303.4184.8.camel@mulgrave.site \
--to=james.bottomley@hansenpartnership.com \
--cc=Daire.Byrne@framestore.com \
--cc=abelay@mit.edu \
--cc=agk@redhat.com \
--cc=alan@l \
--cc=deller@gmx.de \
--cc=dm-devel@redhat.com \
--cc=fweisbec@gmail.com \
--cc=gnb@melbourne.sgi.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=jack@suse.cz \
--cc=jejb@parisc-linux.org \
--cc=jens.axboe@oracle.com \
--cc=jmorris@namei.org \
--cc=julia@diku.dk \
--cc=linux-cachefs@redhat.com \
--cc=mingo@redhat.com \
--cc=neilb@suse.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=proski@gnu.org \
--cc=sandeen@redhat.com \
--cc=snitzer@redhat.com \
--cc=stefan.haberland@de.ibm.com \
--cc=tiwai@suse.de \
--cc=wein@de.ibm.com \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).