diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-08-09 20:05:22 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-08-23 20:02:00 +0200 |
commit | 7687d57b337a16e82d0e70725a83c0e612d16f93 (patch) | |
tree | 85624a4b40d50d3eba7a9ca4b26b5f567c4ef334 /userspace/ncrypto_key.c | |
parent | aac00a3bf423f77344f62d129ef0050fea711756 (diff) | |
download | cryptodev-linux-7687d57b337a16e82d0e70725a83c0e612d16f93.tar.gz cryptodev-linux-7687d57b337a16e82d0e70725a83c0e612d16f93.tar.xz cryptodev-linux-7687d57b337a16e82d0e70725a83c0e612d16f93.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_key.c')
-rw-r--r-- | userspace/ncrypto_key.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/userspace/ncrypto_key.c b/userspace/ncrypto_key.c index 5321c78..9201d43 100644 --- a/userspace/ncrypto_key.c +++ b/userspace/ncrypto_key.c @@ -5,13 +5,12 @@ #include <errno.h> #include <linux/ncr.h> #include "ncrypto.h" - -extern int __ncr_file_descriptor; +#include "ncrypto_internal.h" int ncr_key_init(ncr_key_t *key) { - if ((__ncr_file_descriptor < 0) && (ncr_global_init(0) < 0)) + if ((__ncr_file_descriptor < 0) && (__ncr_global_init() < 0)) return -1; if (ioctl(__ncr_file_descriptor, NCRIO_KEY_INIT, key) < 0) |