Skip to content

Commit 791b4d5

Browse files
herbertxDavid S. Miller
authored andcommitted
[CRYPTO] api: Add missing headers for setkey_unaligned
This patch ensures that kernel.h and slab.h are included for the setkey_unaligned function. It also breaks a couple of long lines. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 39e1ee0 commit 791b4d5

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

‎crypto/ablkcipher.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
#include <crypto/algapi.h>
1717
#include <linux/errno.h>
1818
#include <linux/init.h>
19+
#include <linux/kernel.h>
1920
#include <linux/module.h>
21+
#include <linux/slab.h>
2022
#include <linux/seq_file.h>
2123

22-
static int setkey_unaligned(struct crypto_ablkcipher *tfm, const u8 *key, unsigned int keylen)
24+
static int setkey_unaligned(struct crypto_ablkcipher *tfm, const u8 *key,
25+
unsigned int keylen)
2326
{
2427
struct ablkcipher_alg *cipher = crypto_ablkcipher_alg(tfm);
2528
unsigned long alignmask = crypto_ablkcipher_alignmask(tfm);

‎crypto/blkcipher.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ static int blkcipher_walk_first(struct blkcipher_desc *desc,
339339
return blkcipher_walk_next(desc, walk);
340340
}
341341

342-
static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
342+
static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key,
343+
unsigned int keylen)
343344
{
344345
struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher;
345346
unsigned long alignmask = crypto_tfm_alg_alignmask(tfm);
@@ -360,8 +361,7 @@ static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int
360361
return ret;
361362
}
362363

363-
static int setkey(struct crypto_tfm *tfm, const u8 *key,
364-
unsigned int keylen)
364+
static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
365365
{
366366
struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher;
367367
unsigned long alignmask = crypto_tfm_alg_alignmask(tfm);

‎crypto/cipher.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
#include <linux/kernel.h>
1717
#include <linux/crypto.h>
1818
#include <linux/errno.h>
19-
#include <linux/scatterlist.h>
19+
#include <linux/slab.h>
2020
#include <linux/string.h>
2121
#include "internal.h"
2222

23-
static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
23+
static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key,
24+
unsigned int keylen)
2425
{
2526
struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher;
2627
unsigned long alignmask = crypto_tfm_alg_alignmask(tfm);

‎crypto/hash.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/errno.h>
1313
#include <linux/kernel.h>
1414
#include <linux/module.h>
15+
#include <linux/slab.h>
1516
#include <linux/seq_file.h>
1617

1718
#include "internal.h"
@@ -46,7 +47,7 @@ static int hash_setkey_unaligned(struct crypto_hash *crt, const u8 *key,
4647
}
4748

4849
static int hash_setkey(struct crypto_hash *crt, const u8 *key,
49-
unsigned int keylen)
50+
unsigned int keylen)
5051
{
5152
struct crypto_tfm *tfm = crypto_hash_tfm(crt);
5253
struct hash_alg *alg = &tfm->__crt_alg->cra_hash;

0 commit comments

Comments
 (0)