From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 152503E4C81 for ; Mon, 15 Jun 2026 11:29:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781522950; cv=none; b=RyLt+A3F7pJSN08+dH8E6MzTk/rxtv1gIPyXOWT2jRGZHlrB7mcZr1O10a12iH2tL08DLjRStL+R1hK+9ZKzqzKaEFZe6FwKiA8UlbXHbR8wYPPpBpRs4OpOT0WO/qw1+BmbYSFzRH2+aYDHlNSG9yK2R0Ou69JOOUNKXqDItJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781522950; c=relaxed/simple; bh=eDyfg8pwYMCkqD4JNFWzJvQZbwC43TYiJlqMOP48ebk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tcVqc7TBskYHPtXwTdo1zOaQ5ev8wRNQVubx4s/ZhQBe2sNc7/NiOaWV1hfNIdOa2qYlpj1k33desHOKpGUWC0Ro4Rd8oBsydtdLLvN/H54UoyV62QSuCILUVa8bkC+nVZq7hVJ6dzZuvI41sZ6xIUqsFxHKf2+P0EdvhPGWhcE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=fapvm5KS; arc=none smtp.client-ip=95.215.58.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="fapvm5KS" Date: Mon, 15 Jun 2026 13:28:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781522945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yiCnk5Q5MJ19yCHmxk/qWkpYinZZKtRXpfCsIyWyJ0c=; b=fapvm5KSRO9o60K2EukMsR89usxJf7GgttfuJK6UgoWNj5hvSFuKm670XJwgyVB0lWOWBm yu0nQ2ZGXfkyXOS4YhtFVkFHfu2Mn8Ug1XxSNnOfsLI3gCArxJyX+sH2+f/+4DDh1fm2rL dvEkpz7eg8sNi78RrKAhPQ46PvOp2GE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum To: Lasse Collin Cc: Andrew Morton , linux-kernel@vger.kernel.org, Nathan Chancellor , David Laight Subject: Re: [PATCH 1/2] lib/xz: Use size_t instead of uint32_t in a few places Message-ID: References: <20260614160521.924710-1-lasse.collin@tukaani.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260614160521.924710-1-lasse.collin@tukaani.org> X-Migadu-Flow: FLOW_OUT On Sun, Jun 14, 2026 at 07:05:17PM +0300, Lasse Collin wrote: > Reduce the number of uint32_t <-> size_t conversions a little. Eliminating > such conversions entirely would require changing almost all uint32_t to > size_t, which would look confusing and increase the sizes of the structs > even more. Going the other way, converting everything to uint32_t, isn't > possible because the input and output buffers use size_t in struct xz_buf. > > Now both arguments to min() have the same type. This is required to for > compatibility with PowerPC boot code[1] whose min() is strict like > include/linux/minmax.h was before the commit d03eba99f5bf ("minmax: allow > min()/max()/clamp() if the arguments have the same signedness."). > > Swap the order of the "state" and "len" in struct lzma_dec to avoid > padding in the middle of the struct when size_t is 64 bits. The > reordering doesn't change the size of the struct; the padding just > appears at the end instead. > > dict_flush() used to truncate size_t to uint32_t when returning. > This wasn't a bug; the value is always small enough. > > Reported-by: Nathan Chancellor > Closes: https://lore.kernel.org/lkml/20260610232323.GA1071374@ax162/ [1] > Cc: Thorsten Blum > Cc: David Laight > Signed-off-by: Lasse Collin LGTM, thanks! Reviewed-by: Thorsten Blum