Re: Inline functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01 Mar 2014 10:04:23 +0000, "Summi" said:

> a) inline functions in .c file --> Will it be correct to have inline function
> declared in .c file? I am speaking with respect to device driver meant for the
> linux kernel. I have a function, which is quite short in terms of function body
> and it is exported from one module to another.

If a function is truly inlined, what address is used to be exported?

(Though gcc stops you from that idiocy - if you take the address of the
function, gcc will emit a non-inlined version whether you like it or
not.  Of course, external references to that function will involve
a function call and not be inlined.)

Most of the kernel sticks a 'static inline' in a .h file that's included
in every .c that needs it, and doesn't bother with the EXPORT_SYMBOL.

Attachment: pgp_X7PZiuUAq.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux