mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Petr Mladek <pmladek@suse.com>,
	Thorsten Blum <thorsten.blum@linux.dev>,
	Steven Rostedt <rostedt@goodmis.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib/vsprintf: replace min_t/max_t with min/max
Date: Tue, 2 Jun 2026 21:21:38 +0300	[thread overview]
Message-ID: <bbf03bae-f022-4fc1-80ae-d7edcaa3d313@p183> (raw)

Andy Shevchenko wrote:

> > >  	if (spec.field_width > 0)
> > > -		len = min_t(int, spec.field_width, 64);
> > > +		len = min(spec.field_width, 64);
> >
> > Honestly, I do not see any big advantage in replacing the macros.
> > In fact, the min()/max() macros are even more complex because
> > they check compatibility of the compared types.
> >
> > IMHO, this adds non-necessary churn into the git history without
> > an obvious advantage.
> 
> The advantage I see is to give a good example to others to avoid min_t()
> whenever is possible. I am not insisting to include this patch, just
> share my 2 cents.

Patch is good. "field_width" was bitfield for a long time, so min/max
couldn't be used.

	%alexey

             reply	other threads:[~2026-06-02 18:18 UTC|newest]

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

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=bbf03bae-f022-4fc1-80ae-d7edcaa3d313@p183 \
    --to=adobriyan@gmail.com \
    --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 \
    --cc=thorsten.blum@linux.dev \
    /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®