projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Blackfin] arch: remove NOTES from linker script
[cascardo/linux.git]
/
crypto
/
lrw.c
diff --git
a/crypto/lrw.c
b/crypto/lrw.c
index
b410508
..
8ef664e
100644
(file)
--- a/
crypto/lrw.c
+++ b/
crypto/lrw.c
@@
-91,8
+91,9
@@
struct sinfo {
static inline void inc(be128 *iv)
{
static inline void inc(be128 *iv)
{
- if (!(iv->b = cpu_to_be64(be64_to_cpu(iv->b) + 1)))
- iv->a = cpu_to_be64(be64_to_cpu(iv->a) + 1);
+ be64_add_cpu(&iv->b, 1);
+ if (!iv->b)
+ be64_add_cpu(&iv->a, 1);
}
static inline void lrw_round(struct sinfo *s, void *dst, const void *src)
}
static inline void lrw_round(struct sinfo *s, void *dst, const void *src)
@@
-228,15
+229,20
@@
static void exit_tfm(struct crypto_tfm *tfm)
crypto_free_cipher(ctx->child);
}
crypto_free_cipher(ctx->child);
}
-static struct crypto_instance *alloc(
void *param, unsigned int len
)
+static struct crypto_instance *alloc(
struct rtattr **tb
)
{
struct crypto_instance *inst;
struct crypto_alg *alg;
{
struct crypto_instance *inst;
struct crypto_alg *alg;
+ int err;
+
+ err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER);
+ if (err)
+ return ERR_PTR(err);
- alg = crypto_get_attr_alg(
param, len
, CRYPTO_ALG_TYPE_CIPHER,
- CRYPTO_ALG_TYPE_MASK
| CRYPTO_ALG_ASYNC
);
+ alg = crypto_get_attr_alg(
tb
, CRYPTO_ALG_TYPE_CIPHER,
+ CRYPTO_ALG_TYPE_MASK);
if (IS_ERR(alg))
if (IS_ERR(alg))
- return ERR_
PTR(PTR_ERR(alg)
);
+ return ERR_
CAST(alg
);
inst = crypto_alloc_instance("lrw", alg);
if (IS_ERR(inst))
inst = crypto_alloc_instance("lrw", alg);
if (IS_ERR(inst))