Re: [PATCH] staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove

From: Peter Hüwe
Date: Tue Jan 22 2013 - 17:59:24 EST


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@xxxxxx>
> > ---
> > 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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/