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 7A98BC04A68 for ; Wed, 27 Jul 2022 15:24:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C3E2784072; Wed, 27 Jul 2022 17:24:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="ZtFMAX0q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 271BA8407F; Wed, 27 Jul 2022 17:24:42 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0AA1784062 for ; Wed, 27 Jul 2022 17:24:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AB15FB821AC; Wed, 27 Jul 2022 15:24:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AE4CC433C1; Wed, 27 Jul 2022 15:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658935478; bh=USZaY7/xs/eTjNdr7d6+fnNRe2ez52NxdzpnJuwjoRk=; h=From:To:Cc:Subject:Date:From; b=ZtFMAX0qA8cm6A6yNGBou4ujGuSDoLiMCrFTATY6Mf9GHND8R468k4TpKxsP6ncam eBTHwVRzaM48ATfpnirODAzVV7g3k0gjHdelzjfWzaoXgR/yP6gTeJmVTZiQEwSLP+ JESalQu13aalweNNRzpTKYGnBJb9DQrLXvGZSEV2naCRphAnj1IIGWYBC7xJaxRtTj zKyyZBIQWjkpZmzFZk6BMP4BdfldIf2JQM2Z7NF3bMNu6q3WugtEYAk1b3pMCdNoie PElC+IQP/Ge25WXJA/FoQSgsMbbP3s0I8Zc8ZmMeBQrOWufDthPLBLVsG+4y0Bg4A1 30eYbEo0R7BYQ== Received: by pali.im (Postfix) id A94037C3; Wed, 27 Jul 2022 17:24:35 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass Cc: u-boot@lists.denx.de Subject: [PATCH] lz4: Fix compile warning comparison of distinct pointer types Date: Wed, 27 Jul 2022 17:24:23 +0200 Message-Id: <20220727152423.26792-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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.6 at phobos.denx.de X-Virus-Status: Clean In file included from include/linux/bitops.h:22, from include/log.h:15, from include/linux/printk.h:4, from include/common.h:20, from lib/lz4_wrapper.c:6: lib/lz4_wrapper.c: In function ‘ulz4fn’: include/linux/kernel.h:184:17: warning: comparison of distinct pointer types lacks a cast (void) (&_min1 == &_min2); \ ^~ lib/lz4_wrapper.c:104:18: note: in expansion of macro ‘min’ size_t size = min((ptrdiff_t)block_size, end - out); ^~~ Signed-off-by: Pali Rohár --- lib/lz4_wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lz4_wrapper.c b/lib/lz4_wrapper.c index ebcb5c09a22c..5f8f5af012cf 100644 --- a/lib/lz4_wrapper.c +++ b/lib/lz4_wrapper.c @@ -101,7 +101,7 @@ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn) } if (block_header & LZ4F_BLOCKUNCOMPRESSED_FLAG) { - size_t size = min((ptrdiff_t)block_size, end - out); + size_t size = min((ptrdiff_t)block_size, (ptrdiff_t)(end - out)); memcpy(out, in, size); out += size; if (size < block_size) { -- 2.20.1