public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: use true/false and simplify boolean parameters in btrfs_{inc,dec}_ref
@ 2025-11-20 14:19 Sun YangKai
  2025-11-20 14:19 ` [PATCH 1/2] btrfs: use true/false for " Sun YangKai
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sun YangKai @ 2025-11-20 14:19 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Sun YangKai

This tiny series removes the last 0/1 integer literals passed to
btrfs_inc_ref() / btrfs_dec_ref() and replaces the open-coded
if/else blocks with concise boolean expressions.

Patch 1 switches the callsites to the self-documenting true/false
constants, eliminating the implicit bool <-> int mixing.

Patch 2 folds the remaining if/else ladders into a single line
using the condition directly, which shrinks the code and makes the
intent obvious.

No functional change.

Sun YangKai (2):
  btrfs: use true/false for boolean parameters in btrfs_{inc,dec}_ref
  btrfs: simplify boolean argument for btrfs_{inc,dec}_ref

 fs/btrfs/ctree.c       | 33 +++++++++++----------------------
 fs/btrfs/extent-tree.c | 21 +++++++--------------
 2 files changed, 18 insertions(+), 36 deletions(-)

-- 
2.51.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-11-21 14:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20 14:19 [PATCH 0/2] btrfs: use true/false and simplify boolean parameters in btrfs_{inc,dec}_ref Sun YangKai
2025-11-20 14:19 ` [PATCH 1/2] btrfs: use true/false for " Sun YangKai
2025-11-21  6:59   ` Johannes Thumshirn
2025-11-20 14:19 ` [PATCH 2/2] btrfs: simplify boolean argument for btrfs_{inc,dec}_ref Sun YangKai
2025-11-20 19:02   ` David Sterba
2025-11-21  3:17     ` Sun Yangkai
2025-11-21  6:58       ` Johannes Thumshirn
2025-11-21 14:47         ` David Sterba
2025-11-21  7:21       ` Daniel Vacek
2025-11-20 19:00 ` [PATCH 0/2] btrfs: use true/false and simplify boolean parameters in btrfs_{inc,dec}_ref Boris Burkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox