From nobody Thu Jun 25 01:56:51 2026 Received: from mailscanner10.zoner.fi (mailscanner10.zoner.fi [5.44.246.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 358D240F8E3 for ; Tue, 9 Jun 2026 15:07:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.44.246.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781017671; cv=none; b=ror6Run48QgIv72yFNlVTxC3pnmnwasAR6+M84I8H11H4RzH+Xt3eErA1X7o2eay/as3kfdAlaiugmkEaYj1yR6MAkPT2M2vh9sDCNZ9w7wkB8IUaz8bO+IGX82WQzyAWISWg57mGo26+VjScN20YW88SSQSTsIBfzlxi6s3vFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781017671; c=relaxed/simple; bh=g68iuibthPuQ+CtxZtX+8q0ke/zqEC7q9il9xXcu87s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XiA3dMe0WgLntMZRAqEPnrxXyexLokMn2oBoLpJA/wQp2o6D10gn2URpAI2UzaYMcjpo8CJqY2FBrgGC2qbdbQjLhu7rZmhQNVI8T2Icb8lz8kRcRbMXCZmZ+wE0KpV5DECIgY8MpO8HRBBFOSeBQ+WNRNr+cKIinKWshMnx/6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tukaani.org; spf=pass smtp.mailfrom=tukaani.org; dkim=pass (2048-bit key) header.d=tukaani.org header.i=@tukaani.org header.b=cTK8qv/C; arc=none smtp.client-ip=5.44.246.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tukaani.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tukaani.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tukaani.org header.i=@tukaani.org header.b="cTK8qv/C" Received: from www25.zoner.fi (www25.zoner.fi [84.34.147.45]) by mailscanner10.zoner.fi (Postfix) with ESMTPS id 2CD5321319; Tue, 9 Jun 2026 18:01:07 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tukaani.org ; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To :From:Reply-To:In-Reply-To:References:Content-Type:Content-ID: Content-Description; bh=ScQwXslTpJWzrQw0gtWD2d+SVtRKvsHmhEW97dp+EPw=; b=cTK8q v/CMEQmiJQmboskyCOa94MmWrIMnfdht2prsS5Mhg/lH28nN/b/z4RCPUOY/8HLBhfIdSKjlrkDzY w5jSe6IrKb1e+Delt1UOAmB9ZY29KUq2cwqjAzz6bw9cqddyYd+bj9YAK6kzWezxhkrCzIQC3KSiA AKrxv825IV5oIY8KIPqTl2C2QE/AKiuOIlsA5vc89eL5Yw4nSdu1xJgp9JTkdANxt4nV/8erVxXt9 Tbb/UcHIebavSkpHpSJT+8Gew6hdygdjx3IoM2tSr4oive/tBACxeyp+AL3Fa6IdTtYtheZZ+ZkTk EJ8Pt7tcYPYfvU/hppvqZ6JA/zxxw==; Received: from mail.zoner.fi ([84.34.147.244]) by www25.zoner.fi with esmtp (Exim 4.99.1) (envelope-from ) id 1wWxww-00000006Mzg-453t; Tue, 09 Jun 2026 18:01:06 +0300 From: Lasse Collin To: Andrew Morton Cc: Thorsten Blum , linux-kernel@vger.kernel.org, Lasse Collin Subject: [PATCH] lib/xz: replace min_t with min Date: Tue, 9 Jun 2026 18:00:28 +0300 Message-ID: <20260609150030.634570-1-lasse.collin@tukaani.org> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Thorsten Blum Use the simpler min() macro since the values are unsigned and compatible. Signed-off-by: Thorsten Blum Reviewed-by: Lasse Collin Signed-off-by: Lasse Collin --- 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(-) diff --git a/lib/xz/xz_dec_bcj.c b/lib/xz/xz_dec_bcj.c index cc49a300a5b2..88922323f96e 100644 --- a/lib/xz/xz_dec_bcj.c +++ b/lib/xz/xz_dec_bcj.c @@ -466,7 +466,7 @@ static void bcj_flush(struct xz_dec_bcj *s, struct xz_b= uf *b) { size_t copy_size; =20 - copy_size =3D min_t(size_t, s->temp.filtered, b->out_size - b->out_pos); + copy_size =3D min(s->temp.filtered, b->out_size - b->out_pos); memcpy(b->out + b->out_pos, s->temp.buf, copy_size); b->out_pos +=3D copy_size; =20 diff --git a/lib/xz/xz_dec_lzma2.c b/lib/xz/xz_dec_lzma2.c index 4b783ac94e71..9d80342b9c6b 100644 --- a/lib/xz/xz_dec_lzma2.c +++ b/lib/xz/xz_dec_lzma2.c @@ -354,7 +354,7 @@ static bool dict_repeat(struct dictionary *dict, uint32= _t *len, uint32_t dist) if (dist >=3D dict->full || dist >=3D dict->size) return false; =20 - left =3D min_t(size_t, dict->limit - dict->pos, *len); + left =3D min(dict->limit - dict->pos, *len); *len -=3D left; =20 back =3D dict->pos - dist - 1; @@ -1098,9 +1098,8 @@ enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s, = struct xz_buf *b) * 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; =20 @@ -1260,8 +1259,8 @@ enum xz_ret xz_dec_microlzma_run(struct xz_dec_microl= zma *s_ptr, s->dict.end =3D b->out_size - b->out_pos; =20 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)); =20 if (!lzma2_lzma(s, b)) return XZ_DATA_ERROR; diff --git a/lib/xz/xz_dec_stream.c b/lib/xz/xz_dec_stream.c index 59bfd54ffee7..0bed6daefac2 100644 --- a/lib/xz/xz_dec_stream.c +++ b/lib/xz/xz_dec_stream.c @@ -155,8 +155,8 @@ static const uint8_t check_sizes[16] =3D { */ static bool fill_temp(struct xz_dec *s, struct xz_buf *b) { - size_t copy_size =3D min_t(size_t, - b->in_size - b->in_pos, s->temp.size - s->temp.pos); + size_t copy_size =3D min(b->in_size - b->in_pos, + s->temp.size - s->temp.pos); =20 memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size); b->in_pos +=3D copy_size; --=20 2.54.0