Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132694
b: refs/heads/master
c: 3f683d6
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu committed Feb 18, 2009
1 parent 26e5f99 commit 4a3dbb2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff753308d2f70f210ba468492cd9a01274d9d7ce
refs/heads/master: 3f683d6175748ef9daf4698d9ef5a488dd037063
15 changes: 7 additions & 8 deletions trunk/crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask)
}
EXPORT_SYMBOL_GPL(crypto_alloc_base);

struct crypto_tfm *crypto_create_tfm(struct crypto_alg *alg,
const struct crypto_type *frontend)
void *crypto_create_tfm(struct crypto_alg *alg,
const struct crypto_type *frontend)
{
char *mem;
struct crypto_tfm *tfm = NULL;
Expand Down Expand Up @@ -488,9 +488,9 @@ struct crypto_tfm *crypto_create_tfm(struct crypto_alg *alg,
crypto_shoot_alg(alg);
kfree(mem);
out_err:
tfm = ERR_PTR(err);
mem = ERR_PTR(err);
out:
return tfm;
return mem;
}
EXPORT_SYMBOL_GPL(crypto_create_tfm);

Expand All @@ -514,12 +514,11 @@ EXPORT_SYMBOL_GPL(crypto_create_tfm);
*
* In case of error the return value is an error pointer.
*/
struct crypto_tfm *crypto_alloc_tfm(const char *alg_name,
const struct crypto_type *frontend,
u32 type, u32 mask)
void *crypto_alloc_tfm(const char *alg_name,
const struct crypto_type *frontend, u32 type, u32 mask)
{
struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask);
struct crypto_tfm *tfm;
void *tfm;
int err;

type &= frontend->maskclear;
Expand Down
6 changes: 4 additions & 2 deletions trunk/crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ void crypto_alg_tested(const char *name, int err);
void crypto_shoot_alg(struct crypto_alg *alg);
struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
u32 mask);
struct crypto_tfm *crypto_create_tfm(struct crypto_alg *alg,
const struct crypto_type *frontend);
void *crypto_create_tfm(struct crypto_alg *alg,
const struct crypto_type *frontend);
void *crypto_alloc_tfm(const char *alg_name,
const struct crypto_type *frontend, u32 type, u32 mask);

int crypto_register_instance(struct crypto_template *tmpl,
struct crypto_instance *inst);
Expand Down
18 changes: 5 additions & 13 deletions trunk/crypto/shash.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@
#include <linux/slab.h>
#include <linux/seq_file.h>

static const struct crypto_type crypto_shash_type;

static inline struct crypto_shash *__crypto_shash_cast(struct crypto_tfm *tfm)
{
return container_of(tfm, struct crypto_shash, base);
}

#include "internal.h"

static const struct crypto_type crypto_shash_type;

static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key,
unsigned int keylen)
{
Expand Down Expand Up @@ -282,8 +277,7 @@ static int crypto_init_shash_ops_async(struct crypto_tfm *tfm)
if (!crypto_mod_get(calg))
return -EAGAIN;

shash = __crypto_shash_cast(crypto_create_tfm(
calg, &crypto_shash_type));
shash = crypto_create_tfm(calg, &crypto_shash_type);
if (IS_ERR(shash)) {
crypto_mod_put(calg);
return PTR_ERR(shash);
Expand Down Expand Up @@ -391,8 +385,7 @@ static int crypto_init_shash_ops_compat(struct crypto_tfm *tfm)
if (!crypto_mod_get(calg))
return -EAGAIN;

shash = __crypto_shash_cast(crypto_create_tfm(
calg, &crypto_shash_type));
shash = crypto_create_tfm(calg, &crypto_shash_type);
if (IS_ERR(shash)) {
crypto_mod_put(calg);
return PTR_ERR(shash);
Expand Down Expand Up @@ -480,8 +473,7 @@ static const struct crypto_type crypto_shash_type = {
struct crypto_shash *crypto_alloc_shash(const char *alg_name, u32 type,
u32 mask)
{
return __crypto_shash_cast(
crypto_alloc_tfm(alg_name, &crypto_shash_type, type, mask));
return crypto_alloc_tfm(alg_name, &crypto_shash_type, type, mask);
}
EXPORT_SYMBOL_GPL(crypto_alloc_shash);

Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,6 @@ struct crypto_attr_u32 {
* Transform user interface.
*/

struct crypto_tfm *crypto_alloc_tfm(const char *alg_name,
const struct crypto_type *frontend,
u32 type, u32 mask);
struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask);
void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm);

Expand Down

0 comments on commit 4a3dbb2

Please sign in to comment.