unsigned char *key, unsigned int key_len,
unsigned char *hash, unsigned int *hash_len)
{
- struct scatterlist sl = {0};
+ struct scatterlist sl;
struct hash_desc hdesc;
int err;
const struct cfs_crypto_hash_type *type;
crypto_free_hash(hdesc.tfm);
return -ENOSPC;
}
- sg_set_buf(&sl, (void *)buf, buf_len);
+ sg_init_one(&sl, (void *)buf, buf_len);
hdesc.flags = 0;
err = crypto_hash_digest(&hdesc, &sl, sl.length, hash);
cfs_page_t *page, unsigned int offset,
unsigned int len)
{
- struct scatterlist sl = {0};
+ struct scatterlist sl;
+ sg_init_table(&sl, 1);
sg_set_page(&sl, page, len, offset & ~CFS_PAGE_MASK);
return crypto_hash_update((struct hash_desc *)hdesc, &sl, sl.length);
int cfs_crypto_hash_update(struct cfs_crypto_hash_desc *hdesc,
const void *buf, unsigned int buf_len)
{
- struct scatterlist sl = {0};
+ struct scatterlist sl;
- sg_set_buf(&sl, (void *)buf, buf_len);
+ sg_init_one(&sl, (void *)buf, buf_len);
return crypto_hash_update((struct hash_desc *)hdesc, &sl, sl.length);
}