mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 10:41:49 +02:00
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>
This commit is contained in:
parent
c073ec6bec
commit
ff4cb203cc
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user