summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-08 02:31:24 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-08 02:31:24 +0200
commitd465b18ea8d04ae3fce2e27016de8d3cdcc571e2 (patch)
tree3f7555e9d838ef60f78df90e307f020e3b264099 /crypto
parent7494e29338fedcfeb5ed1e31eefe5742b786a2be (diff)
parentad039cdd4a9c15df11f0e7ed730d4c176e3f8e1a (diff)
downloadkernel-crypto-d465b18ea8d04ae3fce2e27016de8d3cdcc571e2.tar.gz
kernel-crypto-d465b18ea8d04ae3fce2e27016de8d3cdcc571e2.tar.xz
kernel-crypto-d465b18ea8d04ae3fce2e27016de8d3cdcc571e2.zip
Merge branch 'standalone-master' into standalone-rename
Conflicts: examples/cipher.c examples/hmac.c examples/ncr.c examples/pk.c userspace/setkey.c
Diffstat (limited to 'crypto')
-rw-r--r--crypto/userspace/cryptodev_cipher.c4
-rw-r--r--crypto/userspace/cryptodev_main.c6
-rw-r--r--crypto/userspace/ncr-dh.c4
-rw-r--r--crypto/userspace/ncr-int.h2
-rw-r--r--crypto/userspace/ncr-key-storage.c4
-rw-r--r--crypto/userspace/ncr-key-wrap.c4
-rw-r--r--crypto/userspace/ncr-key.c4
-rw-r--r--crypto/userspace/ncr-pk.c4
-rw-r--r--crypto/userspace/ncr-sessions.c11
-rw-r--r--crypto/userspace/ncr.c4
10 files changed, 24 insertions, 23 deletions
diff --git a/crypto/userspace/cryptodev_cipher.c b/crypto/userspace/cryptodev_cipher.c
index 01dc29dc7cc..832202789b6 100644
--- a/crypto/userspace/cryptodev_cipher.c
+++ b/crypto/userspace/cryptodev_cipher.c
@@ -25,10 +25,10 @@
#include <linux/crypto.h>
#include <linux/mm.h>
#include <linux/highmem.h>
+#include <linux/ioctl.h>
#include <linux/random.h>
-#include <asm/uaccess.h>
-#include <asm/ioctl.h>
#include <linux/scatterlist.h>
+#include <linux/uaccess.h>
#include <crypto/algapi.h>
#include <crypto/hash.h>
#include "cryptodev.h"
diff --git a/crypto/userspace/cryptodev_main.c b/crypto/userspace/cryptodev_main.c
index 3223acd1e72..a056b447731 100644
--- a/crypto/userspace/cryptodev_main.c
+++ b/crypto/userspace/cryptodev_main.c
@@ -34,12 +34,12 @@
#include <linux/crypto.h>
#include <linux/mm.h>
#include <linux/highmem.h>
+#include <linux/ioctl.h>
#include <linux/random.h>
#include <linux/syscalls.h>
#include <linux/pagemap.h>
+#include <linux/uaccess.h>
#include "cryptodev.h"
-#include <asm/uaccess.h>
-#include <asm/ioctl.h>
#include <linux/scatterlist.h>
#include "cryptodev_int.h"
#include "ncr-int.h"
@@ -951,7 +951,7 @@ cryptodev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg_)
#endif /* CONFIG_COMPAT */
-static struct file_operations cryptodev_fops = {
+static const struct file_operations cryptodev_fops = {
.owner = THIS_MODULE,
.open = cryptodev_open,
.release = cryptodev_release,
diff --git a/crypto/userspace/ncr-dh.c b/crypto/userspace/ncr-dh.c
index cad4d4c6dc2..235d021fae4 100644
--- a/crypto/userspace/ncr-dh.c
+++ b/crypto/userspace/ncr-dh.c
@@ -22,12 +22,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <linux/ioctl.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/random.h>
+#include <linux/uaccess.h>
#include "cryptodev.h"
-#include <asm/uaccess.h>
-#include <asm/ioctl.h>
#include <linux/scatterlist.h>
#include <ncr.h>
#include <ncr-int.h>
diff --git a/crypto/userspace/ncr-int.h b/crypto/userspace/ncr-int.h
index 008a89b181f..84bca9e3f68 100644
--- a/crypto/userspace/ncr-int.h
+++ b/crypto/userspace/ncr-int.h
@@ -48,7 +48,7 @@ struct session_item_st {
struct page **pages;
unsigned array_size;
unsigned available_pages;
- struct semaphore mem_mutex; /* down when the
+ struct mutex mem_mutex; /* down when the
* values above are changed.
*/
diff --git a/crypto/userspace/ncr-key-storage.c b/crypto/userspace/ncr-key-storage.c
index 41e52b77638..fc6948f5c61 100644
--- a/crypto/userspace/ncr-key-storage.c
+++ b/crypto/userspace/ncr-key-storage.c
@@ -22,11 +22,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <linux/ioctl.h>
#include <linux/mm.h>
#include <linux/slab.h>
+#include <linux/uaccess.h>
#include "cryptodev.h"
-#include <asm/uaccess.h>
-#include <asm/ioctl.h>
#include <linux/scatterlist.h>
#include "ncr.h"
#include "ncr-int.h"
diff --git a/crypto/userspace/ncr-key-wrap.c b/crypto/userspace/ncr-key-wrap.c
index d5d3df0fb43..0c56def27f7 100644
--- a/crypto/userspace/ncr-key-wrap.c
+++ b/crypto/userspace/ncr-key-wrap.c
@@ -22,13 +22,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <linux/ioctl.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/highmem.h>
#include <linux/random.h>
+#include <linux/uaccess.h>
#include "cryptodev.h"
-#include <asm/uaccess.h>
-#include <asm/ioctl.h>
#include <linux/scatterlist.h>
#include "ncr.h"
#include "ncr-int.h"
diff --git a/crypto/userspace/ncr-key.c b/crypto/userspace/ncr-key.c
index 73fd63aaf20..bf438fa22cc 100644
--- a/crypto/userspace/ncr-key.c
+++ b/crypto/userspace/ncr-key.c
@@ -22,12 +22,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <linux/ioctl.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/random.h>
+#include <linux/uaccess.h>
#include "cryptodev.h"
-#include <asm/uaccess.h>
-#include <asm/ioctl.h>
#include <linux/scatterlist.h>
#include "ncr.h"
#include "ncr-int.h"
diff --git a/crypto/userspace/ncr-pk.c b/crypto/userspace/ncr-pk.c
index e5dedbb3d9c..1e83163c155 100644
--- a/crypto/userspace/ncr-pk.c
+++ b/crypto/userspace/ncr-pk.c
@@ -22,12 +22,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <linux/ioctl.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/random.h>
+#include <linux/uaccess.h>
#include "cryptodev.h"
-#include <asm/uaccess.h>
-#include <asm/ioctl.h>
#include <linux/scatterlist.h>
#include "ncr.h"
#include "ncr-int.h"
diff --git a/crypto/userspace/ncr-sessions.c b/crypto/userspace/ncr-sessions.c
index 3109292cfc2..2916729b91a 100644
--- a/crypto/userspace/ncr-sessions.c
+++ b/crypto/userspace/ncr-sessions.c
@@ -24,6 +24,7 @@
*/
#include <linux/crypto.h>
+#include <linux/mutex.h>
#include "cryptodev.h"
#include "ncr.h"
#include "ncr-int.h"
@@ -102,7 +103,7 @@ struct session_item_st* ncr_session_new(struct ncr_lists *lst)
err();
goto err_sess;
}
- init_MUTEX(&sess->mem_mutex);
+ mutex_init(&sess->mem_mutex);
atomic_set(&sess->refcnt, 2); /* One for lst->list, one for "sess" */
@@ -625,7 +626,7 @@ static int _ncr_session_update(struct ncr_lists* lists, struct ncr_session_op_st
return -EINVAL;
}
- if (down_interruptible(&sess->mem_mutex)) {
+ if (mutex_lock_interruptible(&sess->mem_mutex)) {
err();
_ncr_sessions_item_put(sess);
return -ERESTARTSYS;
@@ -706,7 +707,7 @@ fail:
release_user_pages(sess->pages, sess->available_pages);
sess->available_pages = 0;
}
- up(&sess->mem_mutex);
+ mutex_unlock(&sess->mem_mutex);
_ncr_sessions_item_put(sess);
return ret;
@@ -752,7 +753,7 @@ static int _ncr_session_final(struct ncr_lists* lists, struct ncr_session_op_st*
return ret;
}
- if (down_interruptible(&sess->mem_mutex)) {
+ if (mutex_lock_interruptible(&sess->mem_mutex)) {
err();
_ncr_sessions_item_put(sess);
return -ERESTARTSYS;
@@ -879,7 +880,7 @@ fail:
release_user_pages(sess->pages, sess->available_pages);
sess->available_pages = 0;
}
- up(&sess->mem_mutex);
+ mutex_unlock(&sess->mem_mutex);
cryptodev_hash_deinit(&sess->hash);
if (sess->algorithm->is_symmetric) {
diff --git a/crypto/userspace/ncr.c b/crypto/userspace/ncr.c
index d4eb83fb2b0..86c8c7ad8ad 100644
--- a/crypto/userspace/ncr.c
+++ b/crypto/userspace/ncr.c
@@ -23,12 +23,12 @@
*/
#include <linux/crypto.h>
+#include <linux/ioctl.h>
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/random.h>
+#include <linux/uaccess.h>
#include "cryptodev.h"
-#include <asm/uaccess.h>
-#include <asm/ioctl.h>
#include <linux/scatterlist.h>
#include <linux/cred.h>
#include <linux/capability.h>