diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-07-06 22:47:42 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:06 -0400 |
commit | 73bd774d28d2b2e6a05c31bf7afb9247e02a8e49 (patch) | |
tree | 21ab80d4b966d92647ea178bc5707a8534e5d123 /fs/bcachefs/checksum.c | |
parent | 236b68da5017b5336b332f941323a5bc450594b3 (diff) | |
download | linux-73bd774d28d2b2e6a05c31bf7afb9247e02a8e49.tar.gz linux-73bd774d28d2b2e6a05c31bf7afb9247e02a8e49.tar.bz2 linux-73bd774d28d2b2e6a05c31bf7afb9247e02a8e49.zip |
bcachefs: Assorted sparse fixes
- endianness fixes
- mark some things static
- fix a few __percpu annotations
- fix silent enum conversions
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/checksum.c')
-rw-r--r-- | fs/bcachefs/checksum.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/bcachefs/checksum.c b/fs/bcachefs/checksum.c index 843e138862f6..f2a56d786024 100644 --- a/fs/bcachefs/checksum.c +++ b/fs/bcachefs/checksum.c @@ -360,7 +360,7 @@ struct bch_csum bch2_checksum_merge(unsigned type, struct bch_csum a, state.type = type; bch2_checksum_init(&state); - state.seed = a.lo; + state.seed = (u64 __force) a.lo; BUG_ON(!bch2_checksum_mergeable(type)); @@ -371,7 +371,7 @@ struct bch_csum bch2_checksum_merge(unsigned type, struct bch_csum a, page_address(ZERO_PAGE(0)), b); b_len -= b; } - a.lo = bch2_checksum_final(&state); + a.lo = (__le64 __force) bch2_checksum_final(&state); a.lo ^= b.lo; a.hi ^= b.hi; return a; @@ -597,7 +597,7 @@ int bch2_disable_encryption(struct bch_fs *c) if (ret) goto out; - crypt->key.magic = BCH_KEY_MAGIC; + crypt->key.magic = cpu_to_le64(BCH_KEY_MAGIC); crypt->key.key = key; SET_BCH_SB_ENCRYPTION_TYPE(c->disk_sb.sb, 0); @@ -625,7 +625,7 @@ int bch2_enable_encryption(struct bch_fs *c, bool keyed) if (ret) goto err; - key.magic = BCH_KEY_MAGIC; + key.magic = cpu_to_le64(BCH_KEY_MAGIC); get_random_bytes(&key.key, sizeof(key.key)); if (keyed) { |