From patchwork Fri Feb 10 08:26:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1740368 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=wM8Y8qIq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PCn0H3CThz23kw for ; Fri, 10 Feb 2023 19:27:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A98E585C5F; Fri, 10 Feb 2023 09:27:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com 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=canonical.com header.i=@canonical.com header.b="wM8Y8qIq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BE76185C5F; Fri, 10 Feb 2023 09:27:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 660FF85C5F for ; Fri, 10 Feb 2023 09:27:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.fritz.box (ip-088-152-145-137.um26.pools.vodafone-ip.de [88.152.145.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id EBF003FE8D; Fri, 10 Feb 2023 08:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1676017619; bh=sUsYUecrwrCGys88WtmmCvmTGuRA1KdxdcMKXo4ItHk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=wM8Y8qIq5P0wvH1TbYe5P7iOL5hZ3ztZhWRcyr1OzzrDGRGj+WJVaPU1GMYRdO7RA E6Q5x+hS+Kg09YLtCducDkob+d1HwyZg1cKvyL+073jLYdGDG1wSmanh3CTlhxRL+N 2Dx+f58sFfZnmIGrnWcks71+XsL5Q0QGfZYWeeBcYR3hUKsdUzxB/lvDZZi36tvLg1 zDtkfWIkov2nrfOl/MJMGtutkoCCZghTfh02NGs4QmnqyVXLqMc1sN2WOGdot/jwnY jhzn4/uyHMP3jZHDGU1OKJ9S9Af2uh/2r8EnAF6hzQqcmdC2P98CyrETEFcrAqzL4X eBhSVVPCa5Yow== From: Heinrich Schuchardt To: Ilias Apalodimas Cc: u-boot@lists.denx.de, Jose Marinho , Heinrich Schuchardt Subject: [PATCH 1/1] efi_loader: fix efi_ecpt_register() Date: Fri, 10 Feb 2023 09:26:45 +0100 Message-Id: <20230210082646.87438-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 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 num_entries should be unsigned to avoid warnings. As the target field is u16 we should use this type. lib/efi_loader/efi_conformance.c: In function ‘efi_ecpt_register’: lib/efi_loader/efi_conformance.c:30:33: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] 30 | ecpt_size = num_entries * sizeof(efi_guid_t) | ^ lib/efi_loader/efi_conformance.c:46:36: warning: conversion from ‘int’ to ‘u16’ {aka ‘short unsigned int’} may change value [-Wconversion] 46 | ecpt->number_of_profiles = num_entries; | ^~~~~~~~~~~ Fixes: 6b92c1735205 ("efi: Create ECPT table") Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_conformance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_conformance.c b/lib/efi_loader/efi_conformance.c index 3036d46349..0ca26f57a7 100644 --- a/lib/efi_loader/efi_conformance.c +++ b/lib/efi_loader/efi_conformance.c @@ -22,7 +22,7 @@ static const efi_guid_t efi_ebbr_2_1_guid = */ efi_status_t efi_ecpt_register(void) { - int num_entries = 0; + u16 num_entries = 0; struct efi_conformance_profiles_table *ecpt; efi_status_t ret; size_t ecpt_size;