1

Lets say I have a function hello_world() defined in the file new.c. I create a module out of this file new.c and another file hello.c. This module will be called as new.ko. The function hello_world() is exported using EXPORT_SYMBOL to another module. My question is can I use the static inline keyword while defining the function hello_world() since it is not being used by another function outside the file new.c in the module new.ko?

Do static and EXPORT_SYMBOL contradict each other? Thanks.

Daylite
  • 499
  • 1
  • 7
  • 19
  • http://stackoverflow.com/questions/21746378/not-able-to-insmod-or-use-inter-kernel-modules/21746424#21746424 – Jeyaram Feb 27 '14 at 05:32
  • possible duplicate of [Static functions in Linux device driver](http://stackoverflow.com/questions/14423333/static-functions-in-linux-device-driver) – Jeyaram Feb 27 '14 at 05:34

2 Answers2

1

Yes, they contradict each other. You use static to indicate the compiler that you will NOT be calling this function from anywhere outside this file, and EXPORT_SYMBOL is used to do just the opposite.

brokenfoot
  • 11,083
  • 10
  • 59
  • 80
0

Try to use "export" from Makefile.

avlamsox
  • 19
  • 3