diff options
author | Thorsten Blum <thorsten.blum@linux.dev> | 2025-03-11 12:13:11 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-14 21:02:16 -0400 |
commit | ff4cb203ccce24630c50a503973ac596c3d5d1be (patch) | |
tree | b3fe7339c369bcac7c43f70967736c60653600c1 | |
parent | c073ec6bec0d05781380ecabca9e8611e4b48502 (diff) |
bcachefs: Use max() to improve gen_after()
Use max() to simplify gen_after() and improve its readability.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/buckets.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index 6aeec1c0973c..c5363256e363 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -140,9 +140,7 @@ static inline int gen_cmp(u8 a, u8 b) static inline int gen_after(u8 a, u8 b) { - int r = gen_cmp(a, b); - - return r > 0 ? r : 0; + return max(0, gen_cmp(a, b)); } static inline int dev_ptr_stale_rcu(struct bch_dev *ca, const struct bch_extent_ptr *ptr) |