Thread (5 messages) 5 messages, 3 authors, 2021-08-12

Re: [PATCH] x86/pci: Add missing forward declaration for pci_numachip_init()

From: Thomas Gleixner <hidden>
Date: 2021-08-12 15:14:53

On Fri, Jul 30 2021 at 16:19, Bjorn Helgaas wrote:
On Thu, Jul 29, 2021 at 11:40:59PM +0000, Krzysztof Wilczyński wrote:
What should be done with the pci_numachip_init() declaration in
arch/x86/include/asm/numachip/numachip.h?  It doesn't seem like we
should have *two* declarations.
Right. Include that file in the C file and be done with it.
The one in arch/x86/include/asm/numachip/numachip.h is:

  extern int __init pci_numachip_init(void);

I'm not enough of a C language lawyer to know whether "__init" in a
declaration is useful.  It doesn't *seem* like it would be useful
since this is not a definition and the compiler isn't generating code
here.  But "git grep __init include/ arch/*/include" finds quite a few
of them.
__init on the prototype is not having any effect except perhaps
documentary value at least with current compilers.

The attribute magic is vague in both the C specification and the
compiler manuals, but that might change some day in the future. But in
which direction is unknown :)

Thanks,

        tglx
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help