diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-06-17 20:41:18 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-06-17 20:41:18 +0200 |
commit | 439e48a6fea573764b4a98f993510e4921f6d7f1 (patch) | |
tree | 395fa2b7a9ed1877c90a28ad9cb512b1ef4383a7 /cryptodev_main.c | |
parent | 9fd408230f1fc91f8d877b5f55b1c00e8e89f665 (diff) | |
download | cryptodev-linux-439e48a6fea573764b4a98f993510e4921f6d7f1.tar.gz cryptodev-linux-439e48a6fea573764b4a98f993510e4921f6d7f1.tar.xz cryptodev-linux-439e48a6fea573764b4a98f993510e4921f6d7f1.zip |
Avoid the use of packed attribute by directly assigning variables.
Diffstat (limited to 'cryptodev_main.c')
-rw-r--r-- | cryptodev_main.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/cryptodev_main.c b/cryptodev_main.c index 35feefd..9a1f918 100644 --- a/cryptodev_main.c +++ b/cryptodev_main.c @@ -590,7 +590,10 @@ cryptodev_ioctl(struct inode *inode, struct file *filp, static inline void compat_to_session_op(struct compat_session_op *compat, struct session_op *sop) { - memcpy(sop, compat, sizeof(uint32_t) * 3); + sop->cipher = compat->cipher; + sop->mac = compat->mac; + sop->keylen = compat->keylen; + sop->key = (uint8_t *)(unsigned long)compat->key; sop->mackeylen = compat->mackeylen; sop->mackey = (uint8_t *)(unsigned long)compat->mackey; @@ -600,7 +603,10 @@ compat_to_session_op(struct compat_session_op *compat, struct session_op *sop) static inline void session_op_to_compat(struct session_op *sop, struct compat_session_op *compat) { - memcpy(compat, sop, sizeof(uint32_t) * 3); + compat->cipher = sop->cipher; + compat->mac = sop->mac; + compat->keylen = sop->keylen; + compat->key = (unsigned long)sop->key; compat->mackeylen = sop->mackeylen; compat->mackey = (unsigned long)sop->mackey; @@ -610,7 +616,11 @@ session_op_to_compat(struct session_op *sop, struct compat_session_op *compat) static inline void compat_to_crypt_op(struct compat_crypt_op *compat, struct crypt_op *cop) { - memcpy(cop, compat, sizeof(uint32_t) * 2 + sizeof(uint16_t) * 2); + cop->ses = compat->ses; + cop->op = compat->op; + cop->flags = compat->flags; + cop->len = compat->len; + cop->src = (uint8_t *)(unsigned long)compat->src; cop->dst = (uint8_t *)(unsigned long)compat->dst; cop->mac = (uint8_t *)(unsigned long)compat->mac; @@ -620,7 +630,11 @@ compat_to_crypt_op(struct compat_crypt_op *compat, struct crypt_op *cop) static inline void crypt_op_to_compat(struct crypt_op *cop, struct compat_crypt_op *compat) { - memcpy(compat, cop, sizeof(uint32_t) * 2 + sizeof(uint16_t) * 2); + compat->ses = cop->ses; + compat->op = cop->op; + compat->flags = cop->flags; + compat->len = cop->len; + compat->src = (unsigned long)cop->src; compat->dst = (unsigned long)cop->dst; compat->mac = (unsigned long)cop->mac; |