[Suspend2-devel] 2.2.7.1 for 2.6.17 and 2.6.18-rc1.
Bernard Blackham
bernard at blackham.com.au
Thu Jul 6 14:32:42 UTC 2006
On Thu, 2006-07-06 at 17:19 +0300, Alon Bar-Lev wrote:
> Please consider the following patch... I don't know what I am doing,
> but it compiles now :)
> But please also consider to drop all the warnings regarding void * ->
> struct crypto_tfm *tfm at prototypes.
Attached is the full (reversed) diff to lzf.c between 2.6.17 and
2.6.17.1. The changes were needed for 2.6.18-rc1, but aren't compatible
with 2.6.17. This should fix the warnings too.
Bernard.
diff -ruNpax '*.orig' linux-2.6.17-2.2.7.1/crypto/lzf.c linux-2.6.17-2.2.7/crypto/lzf.c
--- linux-2.6.17-2.2.7.1/crypto/lzf.c 2006-07-03 21:18:55.000000000 +0800
+++ linux-2.6.17-2.2.7/crypto/lzf.c 2006-07-06 21:23:21.000000000 +0800
@@ -116,9 +116,9 @@ static const int max_ref = ((1 << 8) +
*
*/
-static void lzf_compress_exit(struct crypto_tfm *tfm)
+static void lzf_compress_exit(void *context)
{
- struct lzf_ctx *ctx = crypto_tfm_ctx(tfm);
+ struct lzf_ctx *ctx = (struct lzf_ctx *)context;
if (ctx->hbuf) {
vfree(ctx->hbuf);
@@ -126,9 +126,9 @@ static void lzf_compress_exit(void *cont
}
}
-static int lzf_compress_init(struct crypto_tfm *tfm)
+static int lzf_compress_init(void *context)
{
- struct lzf_ctx *ctx = crypto_tfm_ctx(tfm);
+ struct lzf_ctx *ctx = (struct lzf_ctx *)context;
/* Get LZF ready to go */
ctx->hbuf = vmalloc_32((1 << hlog) * sizeof(char *));
@@ -141,10 +141,10 @@ static int lzf_compress_init(void *conte
return 0;
}
-static int lzf_compress(struct crypto_tfm *tfm, const u8 *in_data,
- unsigned int in_len, u8 *out_data, unsigned int *out_len)
+static int lzf_compress(void *context, const u8 *in_data, unsigned int in_len,
+ u8 *out_data, unsigned int *out_len)
{
- struct lzf_ctx *ctx = crypto_tfm_ctx(tfm);
+ struct lzf_ctx *ctx = (struct lzf_ctx *)context;
const u8 **htab = ctx->hbuf;
const u8 **hslot;
const u8 *ip = in_data;
@@ -248,8 +248,8 @@ static int lzf_compress(void *context, c
return 0;
}
-static int lzf_decompress(struct crypto_tfm *tfm, const u8 *src,
- unsigned int slen, u8 *dst, unsigned int *dlen)
+static int lzf_decompress(void *context, const u8 *src, unsigned int slen,
+ u8 *dst, unsigned int *dlen)
{
u8 const *ip = src;
u8 *op = dst;
@@ -310,11 +310,11 @@ static struct crypto_alg alg = {
.cra_ctxsize = 0,
.cra_module = THIS_MODULE,
.cra_list = LIST_HEAD_INIT(alg.cra_list),
- .cra_init = lzf_compress_init,
- .cra_exit = lzf_compress_exit,
- .cra_u = { .compress = {
- .coa_compress = lzf_compress,
- .coa_decompress = lzf_decompress } }
+ .cra_u = {.compress = {
+ .coa_init = lzf_compress_init,
+ .coa_exit = lzf_compress_exit,
+ .coa_compress = lzf_compress,
+ .coa_decompress = lzf_decompress}}
};
static int __init init(void)
More information about the TuxOnIce-devel
mailing list