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 B4BF0C433F5 for ; Tue, 21 Dec 2021 15:58:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2FAAE8377B; Tue, 21 Dec 2021 16:56:52 +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="gfN5MVrW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 06CD783383; Tue, 21 Dec 2021 16:56:21 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::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 A97A283492 for ; Tue, 21 Dec 2021 16:55:50 +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 5F7C261668; Tue, 21 Dec 2021 15:55:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A17F6C36AEA; Tue, 21 Dec 2021 15:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640102149; bh=u6eFUyzikJFEwp4bfU30PIe6SgEemDX2edHXJeN6iCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gfN5MVrWJT4jIT5Np8mWAvt+b0r5bLZINf2JDbY3cb1Rwoq5Yjvf/q9cDU295sFi8 DJfEWw+hYwSu6O2LA8a2gMArPLDJRBzK/hV1AoeV8rtE4I37YlqWzvDFVGKtVloWp5 TqPF02DE71SxWCo12y9TTk7kfb1KosDrFw/kG2NZpW/PPyoybV3ZjtFSKaal/E14L8 XV2EI+zREvk/vQofH3RIH+4MFv2q2LCBVG4caZc0X5xsFYUdQTsI8Z52hFrHHz3Psx st+5ZflF5TNEKvfGUW7WAm+RJbUsU7ISKMBTFduCmdFQQxOX7KPgoVTPp6moEU8fcu ERSIVf2TS2BYA== Received: by pali.im (Postfix) id 5A707778; Tue, 21 Dec 2021 16:55:49 +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 13/16] tools: kwbimage: Do not cast const pointers to non-const pointers Date: Tue, 21 Dec 2021 16:54:13 +0100 Message-Id: <20211221155416.8557-14-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211221155416.8557-1-pali@kernel.org> References: <20211221155416.8557-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.38 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