diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-07-27 23:29:21 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-07-27 23:29:21 +0200 |
commit | df4c072acb675a4c89882e3c92442978cf94eedd (patch) | |
tree | 00e0559e4e97fc78631912f83f408e074644f601 /ncr-key-wrap.c | |
parent | 9a2369d426b23f77884b01666370140d10b41c19 (diff) | |
download | cryptodev-linux-df4c072acb675a4c89882e3c92442978cf94eedd.tar.gz cryptodev-linux-df4c072acb675a4c89882e3c92442978cf94eedd.tar.xz cryptodev-linux-df4c072acb675a4c89882e3c92442978cf94eedd.zip |
Use ncr_lists instead of list_sem_st in intefaces
Should result in no functionality change.
This makes the code marginally more effective (reducing the number of
"&lst->key" and "&lst->sessions" operations in the code, and moving them
toward dereferences where they can be combined with member accesses),
and more type-safe (prevents mixing the key and session list in most
places because they the difference is only in the low-level accessor
functions).
Most importantly, this allows replacing list_sem_st without having to
touch most of the functions again.
Diffstat (limited to 'ncr-key-wrap.c')
-rw-r--r-- | ncr-key-wrap.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ncr-key-wrap.c b/ncr-key-wrap.c index 5d3ec67..b66b731 100644 --- a/ncr-key-wrap.c +++ b/ncr-key-wrap.c @@ -427,7 +427,7 @@ cleanup: return ret; } -int ncr_key_wrap(struct list_sem_st* key_lst, void __user* arg) +int ncr_key_wrap(struct ncr_lists *lst, void __user* arg) { struct ncr_key_wrap_st wrap; struct key_item_st* wkey = NULL; @@ -441,7 +441,7 @@ int ret; return -EFAULT; } - ret = ncr_key_item_get_read( &wkey, key_lst, wrap.keytowrap); + ret = ncr_key_item_get_read( &wkey, lst, wrap.keytowrap); if (ret < 0) { err(); return ret; @@ -453,7 +453,7 @@ int ret; goto fail; } - ret = ncr_key_item_get_read( &key, key_lst, wrap.key); + ret = ncr_key_item_get_read( &key, lst, wrap.key); if (ret < 0) { err(); goto fail; @@ -510,7 +510,7 @@ fail: /* Unwraps keys. All keys unwrapped are not accessible by * userspace. */ -int ncr_key_unwrap(struct list_sem_st* key_lst, void __user* arg) +int ncr_key_unwrap(struct ncr_lists *lst, void __user* arg) { struct ncr_key_wrap_st wrap; struct key_item_st* wkey = NULL; @@ -524,13 +524,13 @@ int ret; return -EFAULT; } - ret = ncr_key_item_get_write( &wkey, key_lst, wrap.keytowrap); + ret = ncr_key_item_get_write( &wkey, lst, wrap.keytowrap); if (ret < 0) { err(); return ret; } - ret = ncr_key_item_get_read( &key, key_lst, wrap.key); + ret = ncr_key_item_get_read( &key, lst, wrap.key); if (ret < 0) { err(); goto fail; @@ -572,7 +572,7 @@ fail: return ret; } -int ncr_key_storage_wrap(struct list_sem_st* key_lst, void __user* arg) +int ncr_key_storage_wrap(struct ncr_lists *lst, void __user* arg) { struct ncr_key_storage_wrap_st wrap; struct key_item_st* wkey = NULL; @@ -592,7 +592,7 @@ int ret; return -EFAULT; } - ret = ncr_key_item_get_read( &wkey, key_lst, wrap.keytowrap); + ret = ncr_key_item_get_read( &wkey, lst, wrap.keytowrap); if (ret < 0) { err(); return ret; @@ -648,7 +648,7 @@ fail: /* Unwraps keys. All keys unwrapped are not accessible by * userspace. */ -int ncr_key_storage_unwrap(struct list_sem_st* key_lst, void __user* arg) +int ncr_key_storage_unwrap(struct ncr_lists *lst, void __user* arg) { struct ncr_key_storage_wrap_st wrap; struct key_item_st* wkey = NULL; @@ -667,7 +667,7 @@ int ret; return -EFAULT; } - ret = ncr_key_item_get_write( &wkey, key_lst, wrap.keytowrap); + ret = ncr_key_item_get_write( &wkey, lst, wrap.keytowrap); if (ret < 0) { err(); return ret; |