diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-08-09 20:05:22 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-08-24 20:58:32 +0200 |
commit | 22aabeef3cb9344614cc9b58e9e97208df04e711 (patch) | |
tree | a6ad50c347395252015d0d648ab25cd69e2b09ba /userspace/ncrypto_fd.c | |
parent | c8ccfedd9bfd53274800d39f58ed335db97caf1a (diff) | |
download | cryptodev-linux-22aabeef3cb9344614cc9b58e9e97208df04e711.tar.gz cryptodev-linux-22aabeef3cb9344614cc9b58e9e97208df04e711.tar.xz cryptodev-linux-22aabeef3cb9344614cc9b58e9e97208df04e711.zip |
Avoid unnecessary internal relocations
Use __attribute__((visibility("hidden"))) for __ncr_file_descriptor to
take advantage of PIC addressing instead of going through the dynamic
linker. Add an internal alias for ncr_global_init() for the same
reason.
Add an internal header file to consolidate the "extern" references in
the process.
Diffstat (limited to 'userspace/ncrypto_fd.c')
-rw-r--r-- | userspace/ncrypto_fd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/userspace/ncrypto_fd.c b/userspace/ncrypto_fd.c index 7e6741d..f4dee3e 100644 --- a/userspace/ncrypto_fd.c +++ b/userspace/ncrypto_fd.c @@ -5,13 +5,14 @@ #include <unistd.h> #include <linux/ncr.h> #include "ncrypto.h" +#include "ncrypto_internal.h" int __ncr_file_descriptor = -1; static int open_count = 0; static pthread_mutex_t open_lock = PTHREAD_MUTEX_INITIALIZER; int -ncr_global_init(unsigned int flags) +__ncr_global_init() { int rv = 0; @@ -25,6 +26,12 @@ ncr_global_init(unsigned int flags) return rv; } +int +ncr_global_init(unsigned int flags) +{ + return __ncr_global_init(); +} + void ncr_global_deinit(void) { |