All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Petr Mladek <pmladek@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>, linux-kernel@vger.kernel.org
Subject: [PATCH] lib/vsprintf: replace min_t/max_t with min/max
Date: Mon, 18 May 2026 14:31:47 +0200	[thread overview]
Message-ID: <20260518123145.79411-3-thorsten.blum@linux.dev> (raw)

Use the simpler min()/max() macros since the values are all compatible.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 lib/vsprintf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 9f359b31c8d1..57ae85680536 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1208,7 +1208,7 @@ char *hex_string(char *buf, char *end, u8 *addr, struct printf_spec spec,
 	}
 
 	if (spec.field_width > 0)
-		len = min_t(int, spec.field_width, 64);
+		len = min(spec.field_width, 64);
 
 	for (i = 0; i < len; ++i) {
 		if (buf < end)
@@ -1233,7 +1233,7 @@ char *bitmap_string(char *buf, char *end, const unsigned long *bitmap,
 		    struct printf_spec spec, const char *fmt)
 {
 	const int CHUNKSZ = 32;
-	int nr_bits = max_t(int, spec.field_width, 0);
+	int nr_bits = max(spec.field_width, 0);
 	int i, chunksz;
 	bool first = true;
 
@@ -1276,7 +1276,7 @@ static noinline_for_stack
 char *bitmap_list_string(char *buf, char *end, const unsigned long *bitmap,
 			 struct printf_spec spec, const char *fmt)
 {
-	int nr_bits = max_t(int, spec.field_width, 0);
+	int nr_bits = max(spec.field_width, 0);
 	bool first = true;
 	int rbot, rtop;
 

             reply	other threads:[~2026-05-18 12:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 12:31 Thorsten Blum [this message]
2026-05-21 13:49 ` [PATCH] lib/vsprintf: replace min_t/max_t with min/max Petr Mladek
2026-06-02 18:02   ` Andy Shevchenko
2026-06-03  9:35   ` David Laight
2026-06-03 12:01     ` Petr Mladek
  -- strict thread matches above, loose matches on Subject: below --
2026-06-02 18:21 Alexey Dobriyan

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=20260518123145.79411-3-thorsten.blum@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.