summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-09-01 22:09:11 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-09-21 18:35:20 +0300
commitda2d20c98d32bbedc187f2b8fdb70d08fdeff057 (patch)
tree9989d97aec8cdaad504f5e3177c8d3b56ea51fbb /fs
parentaf05633d4065673697c3f17de5db09938f96ebca (diff)
downloadlinux-da2d20c98d32bbedc187f2b8fdb70d08fdeff057.tar.xz
bcachefs: kill redundant is_vmalloc_addr()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r--fs/bcachefs/checksum.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/bcachefs/checksum.c b/fs/bcachefs/checksum.c
index 398177eb9c66..ce8fc677bef9 100644
--- a/fs/bcachefs/checksum.c
+++ b/fs/bcachefs/checksum.c
@@ -117,14 +117,10 @@ static inline int do_encrypt(struct crypto_sync_skcipher *tfm,
void *buf, size_t len)
{
if (!is_vmalloc_addr(buf)) {
- struct scatterlist sg;
-
- sg_init_table(&sg, 1);
- sg_set_page(&sg,
- is_vmalloc_addr(buf)
- ? vmalloc_to_page(buf)
- : virt_to_page(buf),
- len, offset_in_page(buf));
+ struct scatterlist sg = {};
+
+ sg_mark_end(&sg);
+ sg_set_page(&sg, virt_to_page(buf), len, offset_in_page(buf));
return do_encrypt_sg(tfm, nonce, &sg, len);
} else {
DARRAY_PREALLOCATED(struct scatterlist, 4) sgl;