]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/scatterlist.h
[CRYPTO] drivers: Remove obsolete block cipher operations
[mirror_ubuntu-bionic-kernel.git] / include / linux / scatterlist.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_SCATTERLIST_H
2#define _LINUX_SCATTERLIST_H
3
d32311fe
HX
4#include <asm/scatterlist.h>
5#include <linux/mm.h>
6#include <linux/string.h>
1da177e4 7
d32311fe
HX
8static inline void sg_set_buf(struct scatterlist *sg, void *buf,
9 unsigned int buflen)
10{
1da177e4
LT
11 sg->page = virt_to_page(buf);
12 sg->offset = offset_in_page(buf);
13 sg->length = buflen;
14}
15
d32311fe
HX
16static inline void sg_init_one(struct scatterlist *sg, void *buf,
17 unsigned int buflen)
18{
19 memset(sg, 0, sizeof(*sg));
20 sg_set_buf(sg, buf, buflen);
21}
22
1da177e4 23#endif /* _LINUX_SCATTERLIST_H */