From: "Peter Hüwe" <PeterHuewe@gmx.de>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>,
Mori Hess <fmhess@users.sourceforge.net>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove
Date: Wed, 23 Jan 2013 00:02:48 +0100 [thread overview]
Message-ID: <201301230002.48551.PeterHuewe@gmx.de> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F00207A6F697BB@AUSP01VMBX24.collaborationhost.net>
Am Dienstag, 22. Januar 2013, 23:49:53 schrieb H Hartley Sweeten:
> On Tuesday, January 22, 2013 3:40 PM, Peter Huewe wrote:
> > (Almost) all comedi pci drivers have some wrapper for their
> >
> > pci_driver.remove function which simply calls comedi_pci_auto_unconfig
> > which has the same function prototype as the wrapper.
> >
> > -> we can remove these wrappers and call comedi_pci_auto_unconfig
> > directly. This removes a lot some boilerplate code and saves some bytes.
> >
> > Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> > ---
> > Maybe we should move the implementation now to drivers.c,
> > because now it cannot be inlined anymore.
> > This would save some more bytes in the .kos but comedi_pci_auto_unconfig
> > then has to become an exported symbol.
>
> Did you build this?
>
> As you mention above, the inlined comedi_pci_auto_unconfig() will not
> work as a function pointer in the pci_driver structs.
>
> This cannot work until/if comedi_pci_auto_unconfig() is made an exported
> symbol. I'll leave that decision up to Ian.
>
> Regards,
> Hartley
Hi,
yes I did build it - and it did build fine.
That's how I could find out about the size of the .kos
On my machine all comedi .kos before the patch sum up to 9828 bytes.
After applying this patch it comes down to 9812 bytes
If I put the comedi_pci_auto_unconfig into drivers.c and export it, it comes
down to 9752 bytes.
The gcc probably simply does not inline it anymore - inline is just a
suggestion to the compiler.
I did some google searching before submitting it, and it seems that is indeed
possible.
e.g.:
http://stackoverflow.com/questions/8885665/c-pointer-to-inline-function
Nevertheless I'll send a patch which moves the comedi_pci_auto_unconfig to
drivers.c
Thanks,
Peter
next prev parent reply other threads:[~2013-01-22 22:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-22 22:40 [PATCH] staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove Peter Huewe
2013-01-22 22:49 ` H Hartley Sweeten
2013-01-22 23:02 ` Peter Hüwe [this message]
2013-01-22 23:03 ` [PATCH] staging/comedi: Move comedi_pci_auto_unconfig to drivers.c Peter Huewe
2013-01-24 10:02 ` Ian Abbott
2013-01-24 21:30 ` Peter Huewe
2013-01-25 10:58 ` Ian Abbott
2013-01-25 20:09 ` Greg Kroah-Hartman
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=201301230002.48551.PeterHuewe@gmx.de \
--to=peterhuewe@gmx.de \
--cc=abbotti@mev.co.uk \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=fmhess@users.sourceforge.net \
--cc=gregkh@linuxfoundation.org \
--cc=hartleys@visionengravers.com \
--cc=linux-kernel@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