From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65586C433F5 for ; Mon, 28 Feb 2022 19:11:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2819B838D5; Mon, 28 Feb 2022 20:10:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TZhC9X+y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44AB283B71; Mon, 28 Feb 2022 20:09:25 +0100 (CET) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 242EA83BE8 for ; Mon, 28 Feb 2022 20:09:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x330.google.com with SMTP id u17-20020a056830231100b005ad13358af9so10261777ote.11 for ; Mon, 28 Feb 2022 11:09:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MCgwYtEdhVB0CSZRAS4m+R0u7Of7LS6zEIGHwP/hru4=; b=TZhC9X+yd5ALAQ6u+TqzC58bV4yBDBQ8xksA2RiL75Bmy58q2Lciyqg5KI02hD2p8M 6xCljc8c6c8gIOObz910KUXrhFHeBUpeh7m68yODvt4/vy21BLkbv8bdwt0K8fH97D38 Y77EzJp377/yjGuRabWMr6mTp66YQAyjawH7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MCgwYtEdhVB0CSZRAS4m+R0u7Of7LS6zEIGHwP/hru4=; b=oAs90vAXyLicmEEOrSH6Q6yK1fvhUi0OnH7MJDFjk4uQDi3Nm9qMHPEKNQZ+rVCOw/ Z0byHoFnQm8DtBdbDwhcbr0eb6H3NKUHL/0Jd5VAeRavROX/B9It0lNgxkP2IWkHIH88 7sWaYGvFXA7C/FsNoKQxzeRDDy1J32bwtS9JSKEBKedUvBkFK+Cin7ty79+BBGYFxwO6 8kaPTTZ8PgBhh+usr0bNA3J0TQYkcbt8AN6l82vof1DSZWHX8LGTXMLzTjRJSnuykLKp PGrO+ccUla4uH7mErLRxXIBQU/WTjsL+K78Q5e9C7OOnGLOCoR+iaU+ipFco05l3rZb0 kYBQ== X-Gm-Message-State: AOAM531xSJRxjw+KnFBkAr9yJ61mxsq8DTvkZcd1yx5T8/4YfHPuz9Dh W8LKz3ucT0YHmO6fDtAeiYSl5/8adxAMRQ== X-Google-Smtp-Source: ABdhPJysTw4i/75JDWXW4D3cLVF/hycxSZi2RHF18uKQWY+Ve+0+pi2ARvUYB0yB0eJZPHoALjJwBQ== X-Received: by 2002:a9d:7ac2:0:b0:5af:5897:6125 with SMTP id m2-20020a9d7ac2000000b005af58976125mr10010217otn.233.1646075348517; Mon, 28 Feb 2022 11:09:08 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id f188-20020a4a58c5000000b0031ccb8272f1sm5290577oob.33.2022.02.28.11.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 11:09:08 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 08/18] lzma: Tidy up the function prototype Date: Mon, 28 Feb 2022 12:08:25 -0700 Message-Id: <20220228190835.1480772-9-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.574.g5d30c73bfb-goog In-Reply-To: <20220228190835.1480772-1-sjg@chromium.org> References: <20220228190835.1480772-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean This should use a const pointer for the input stream. Fix this and also add a proper comment. Signed-off-by: Simon Glass --- lib/lzma/LzmaTools.c | 4 ++-- lib/lzma/LzmaTools.h | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/lzma/LzmaTools.c b/lib/lzma/LzmaTools.c index 521258e623..af88900d31 100644 --- a/lib/lzma/LzmaTools.c +++ b/lib/lzma/LzmaTools.c @@ -37,8 +37,8 @@ static void *SzAlloc(void *p, size_t size) { return malloc(size); } static void SzFree(void *p, void *address) { free(address); } -int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize, - unsigned char *inStream, SizeT length) +int lzmaBuffToBuffDecompress(unsigned char *outStream, SizeT *uncompressedSize, + const unsigned char *inStream, SizeT length) { int res = SZ_ERROR_DATA; int i; diff --git a/lib/lzma/LzmaTools.h b/lib/lzma/LzmaTools.h index e52dfb8fac..2c46859a62 100644 --- a/lib/lzma/LzmaTools.h +++ b/lib/lzma/LzmaTools.h @@ -13,6 +13,19 @@ #include -extern int lzmaBuffToBuffDecompress (unsigned char *outStream, SizeT *uncompressedSize, - unsigned char *inStream, SizeT length); +/** + * lzmaBuffToBuffDecompress() - Decompress LZMA data + * + * @outStream: output buffer + * @uncompressedSize: On entry, the mnaximum uncompressed size of the data; + * on exit, the actual uncompressed size after processing + * @inStream: Compressed bytes to decompress + * @length: Sizeof @inStream + * @return 0 if OK, SZ_ERROR_DATA if the data is in a format that cannot be + * decompressed; SZ_ERROR_OUTPUT_EOF if *uncompressedSize is too small; + * see also other SZ_ERROR... values + */ +int lzmaBuffToBuffDecompress(unsigned char *outStream, SizeT *uncompressedSize, + const unsigned char *inStream, SizeT length); + #endif -- 2.35.1.574.g5d30c73bfb-goog