summaryrefslogtreecommitdiffstats
path: root/ncr-key-wrap.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-27 23:29:21 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-27 23:29:21 +0200
commitdf4c072acb675a4c89882e3c92442978cf94eedd (patch)
tree00e0559e4e97fc78631912f83f408e074644f601 /ncr-key-wrap.c
parent9a2369d426b23f77884b01666370140d10b41c19 (diff)
downloadkernel-crypto-df4c072acb675a4c89882e3c92442978cf94eedd.tar.gz
kernel-crypto-df4c072acb675a4c89882e3c92442978cf94eedd.tar.xz
kernel-crypto-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.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ncr-key-wrap.c b/ncr-key-wrap.c
index 5d3ec675b6c..b66b731540f 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;