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 7DC26C433F5 for ; Wed, 12 Jan 2022 17:24:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1D8EA83520; Wed, 12 Jan 2022 18:22:24 +0100 (CET) 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="KLTdEdpo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CE73A83178; Wed, 12 Jan 2022 18:22:11 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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 D18F1834B1 for ; Wed, 12 Jan 2022 18:21:57 +0100 (CET) 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 dfw.source.kernel.org (Postfix) with ESMTPS id CC96261770; Wed, 12 Jan 2022 17:21:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F3C5C36AE5; Wed, 12 Jan 2022 17:21:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642008116; bh=u6eFUyzikJFEwp4bfU30PIe6SgEemDX2edHXJeN6iCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KLTdEdpoF69jtzMtO7Ffoo9cGAsurJngwM+6CxiVnCeu0FKCFSG7g+gDI4nH1X7Si ywzPGlC95GrPzGe+GIRS0OihS026QD07H2axVoR494ZTa8CaO/GeXCbzlHF5WChaMQ /xZqTLV42O6ZqdFuujhIZMj12h0cW3qW5svK9TSJMRo4Jt0ZEQcExSNhTE7Dwlp9ud nH/dREadiNMW/HAM//nzUyDCgWP4DJJxZ/xHij3OMxNn8o9kYnfXWn3EYU0q0mw2QD +P28VyxeZWw1usCGZwEg8AZSzz1/SF5NMFiGSdbvG+MsoT7oWUbttBFV0DPJ7PkFdI ZOCy/Ksy91AEw== Received: by pali.im (Postfix) id C9B8C768; Wed, 12 Jan 2022 18:21:55 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Chris Packham Cc: u-boot@lists.denx.de Subject: [PATCH u-boot-marvell v2 17/20] tools: kwbimage: Do not cast const pointers to non-const pointers Date: Wed, 12 Jan 2022 18:20:51 +0100 Message-Id: <20220112172054.5961-18-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220112172054.5961-1-pali@kernel.org> References: <20211221155416.8557-1-pali@kernel.org> <20220112172054.5961-1-pali@kernel.org> 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.2 at phobos.denx.de X-Virus-Status: Clean Avoid casting const to non-const. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún --- tools/kwbimage.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kwbimage.h b/tools/kwbimage.h index 8d37357e5abd..c000cba4b8d1 100644 --- a/tools/kwbimage.h +++ b/tools/kwbimage.h @@ -235,11 +235,11 @@ static inline int opt_hdr_v1_valid_size(const struct opt_hdr_v1 *ohdr, { uint32_t ohdr_size; - if ((void *)(ohdr + 1) > mhdr_end) + if ((const void *)(ohdr + 1) > mhdr_end) return 0; ohdr_size = opt_hdr_v1_size(ohdr); - if (ohdr_size < 8 || (void *)((uint8_t *)ohdr + ohdr_size) > mhdr_end) + if (ohdr_size < 8 || (const void *)((const uint8_t *)ohdr + ohdr_size) > mhdr_end) return 0; return 1; -- 2.20.1