* + lib-xz-replace-min_t-with-min.patch added to mm-nonmm-unstable branch
@ 2026-06-09 19:50 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-06-09 19:50 UTC (permalink / raw)
To: mm-commits, lasse.collin, thorsten.blum, akpm
The patch titled
Subject: lib/xz: replace min_t with min
has been added to the -mm mm-nonmm-unstable branch. Its filename is
lib-xz-replace-min_t-with-min.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/lib-xz-replace-min_t-with-min.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Thorsten Blum <thorsten.blum@linux.dev>
Subject: lib/xz: replace min_t with min
Date: Tue, 9 Jun 2026 18:00:28 +0300
Use the simpler min() macro since the values are unsigned and compatible.
Link: https://lore.kernel.org/20260609150030.634570-1-lasse.collin@tukaani.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/xz/xz_dec_bcj.c | 2 +-
lib/xz/xz_dec_lzma2.c | 11 +++++------
lib/xz/xz_dec_stream.c | 4 ++--
3 files changed, 8 insertions(+), 9 deletions(-)
--- a/lib/xz/xz_dec_bcj.c~lib-xz-replace-min_t-with-min
+++ a/lib/xz/xz_dec_bcj.c
@@ -466,7 +466,7 @@ static void bcj_flush(struct xz_dec_bcj
{
size_t copy_size;
- copy_size = min_t(size_t, s->temp.filtered, b->out_size - b->out_pos);
+ copy_size = min(s->temp.filtered, b->out_size - b->out_pos);
memcpy(b->out + b->out_pos, s->temp.buf, copy_size);
b->out_pos += copy_size;
--- a/lib/xz/xz_dec_lzma2.c~lib-xz-replace-min_t-with-min
+++ a/lib/xz/xz_dec_lzma2.c
@@ -354,7 +354,7 @@ static bool dict_repeat(struct dictionar
if (dist >= dict->full || dist >= dict->size)
return false;
- left = min_t(size_t, dict->limit - dict->pos, *len);
+ left = min(dict->limit - dict->pos, *len);
*len -= left;
back = dict->pos - dist - 1;
@@ -1098,9 +1098,8 @@ enum xz_ret xz_dec_lzma2_run(struct xz_d
* the output buffer yet, we may run this loop
* multiple times without changing s->lzma2.sequence.
*/
- dict_limit(&s->dict, min_t(size_t,
- b->out_size - b->out_pos,
- s->lzma2.uncompressed));
+ dict_limit(&s->dict, min(b->out_size - b->out_pos,
+ s->lzma2.uncompressed));
if (!lzma2_lzma(s, b))
return XZ_DATA_ERROR;
@@ -1260,8 +1259,8 @@ enum xz_ret xz_dec_microlzma_run(struct
s->dict.end = b->out_size - b->out_pos;
while (true) {
- dict_limit(&s->dict, min_t(size_t, b->out_size - b->out_pos,
- s->lzma2.uncompressed));
+ dict_limit(&s->dict, min(b->out_size - b->out_pos,
+ s->lzma2.uncompressed));
if (!lzma2_lzma(s, b))
return XZ_DATA_ERROR;
--- a/lib/xz/xz_dec_stream.c~lib-xz-replace-min_t-with-min
+++ a/lib/xz/xz_dec_stream.c
@@ -155,8 +155,8 @@ static const uint8_t check_sizes[16] = {
*/
static bool fill_temp(struct xz_dec *s, struct xz_buf *b)
{
- size_t copy_size = min_t(size_t,
- b->in_size - b->in_pos, s->temp.size - s->temp.pos);
+ size_t copy_size = min(b->in_size - b->in_pos,
+ s->temp.size - s->temp.pos);
memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size);
b->in_pos += copy_size;
_
Patches currently in -mm which might be from thorsten.blum@linux.dev are
lib-xz-replace-min_t-with-min.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-09 19:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 19:50 + lib-xz-replace-min_t-with-min.patch added to mm-nonmm-unstable branch Andrew Morton
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.