mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: George Hu <integral@archlinux.org>, wqu@suse.com
Cc: clm@fb.com, dsterba@suse.com, josef@toxicpanda.com,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: replace nested usage of min & max with clamp in btrfs_compress_set_level()
Date: Sat, 28 Jun 2025 14:56:42 +0930	[thread overview]
Message-ID: <b316d443-107d-4c85-81cf-37fe653cc8a6@gmx.com> (raw)
In-Reply-To: <20250628052130.36111-1-integral@archlinux.org>



在 2025/6/28 14:51, George Hu 写道:
> Refactor the btrfs_compress_set_level() function by replacing the
> nested usage of min() and max() macro with clamp() to simplify the
> code and improve readability.
> 
> Signed-off-by: George Hu <integral@archlinux.org>

Reviewed-by: Qu Wenruo <wqu@suse.com>

And merged into for-next branch.

Thanks,
Qu

> ---
>   fs/btrfs/compression.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index 48d07939fee4..be8d51c53f39 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -975,7 +975,7 @@ static int btrfs_compress_set_level(unsigned int type, int level)
>   	if (level == 0)
>   		level = ops->default_level;
>   	else
> -		level = min(max(level, ops->min_level), ops->max_level);
> +		level = clamp(level, ops->min_level, ops->max_level);
>   
>   	return level;
>   }


  reply	other threads:[~2025-06-28  5:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-28  4:32 [PATCH] " George Hu
2025-06-28  4:48 ` Qu Wenruo
2025-06-28  5:21   ` [PATCH v2] " George Hu
2025-06-28  5:26     ` Qu Wenruo [this message]
2025-06-30 16:12     ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b316d443-107d-4c85-81cf-37fe653cc8a6@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=integral@archlinux.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®