public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: Pierre Gondois <Pierre.Gondois@arm.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com>,
	Girish Mahadevan <gmahadevan@nvidia.com>,
	"Jeff Brasen (jbrasen@nvidia.com)" <jbrasen@nvidia.com>,
	Jeshua Smith <jeshuas@nvidia.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	"Meenakshi Aggarwal (meenakshi.aggarwal@nxp.com)"
	<meenakshi.aggarwal@nxp.com>,
	Sunil V L <sunilvl@ventanamicro.com>,
	Yeo Reum Yun <YeoReum.Yun@arm.com>, nd <nd@arm.com>
Subject: Re: [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings
Date: Wed, 3 Jul 2024 10:35:59 +0000	[thread overview]
Message-ID: <CC089BAB-489D-4F28-AFF8-BEA291FD5144@arm.com> (raw)
In-Reply-To: <20240703095340.3402057-2-pierre.gondois@arm.com>

Hi Pierre,

Thank you for these patches.


On 03/07/2024, 10:54, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:


Some CM objects fields are wider than the targeted field in ACPI
tables. Some assignments are also subject to data loss and
trigger the following warnings:
- '<': signed/unsigned mismatch
- '=': conversion from 'UINTxx' to 'UINTyy', possible loss of data
with xx > yy.


Add checks/cast to remove the warnings.


Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com <mailto:Pierre.Gondois@arm.com>>
---
.../Acpi/Common/AcpiPcctLib/PcctGenerator.c | 15 +++++++++++----
.../SsdtCpuTopologyGenerator.c | 6 ++++--
.../Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c | 15 ++++++++++-----
3 files changed, 25 insertions(+), 11 deletions(-)


diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
index 205c44405785..061e12bf1b3d 100644
--- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c
@@ -379,10 +379,12 @@ AddSubspaceStructType1 (
Doorbell = &GenericPccCmObj->DoorbellReg;


ChannelTiming = &GenericPccCmObj->ChannelTiming;






+ ASSERT ((PccCmObj->PlatIrq.Flags >> 8) == 0);

[SAMI] I think we can change this to ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
That way we can also avoid magic numbers. 
I think similar changes are required elsewhere in this patch. 
If you agree, I will make the changes before merging.

Otherwise, this series looks good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>


Regards,

Sami Mujawar



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119781): https://edk2.groups.io/g/devel/message/119781
Mute This Topic: https://groups.io/mt/107016603/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-07-03 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03  9:53 [edk2-devel] [staging/dynamictables-reorg PATCH 0/2] DynamicTablesPkg: CI related fixes PierreGondois
2024-07-03  9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 1/2] DynamicTablesPkg: Fix conversion compiler warnings PierreGondois
2024-07-03 10:35   ` Sami Mujawar [this message]
2024-07-03 10:44     ` PierreGondois
2024-07-03  9:53 ` [edk2-devel] [staging/dynamictables-reorg PATCH 2/2] DynamicTablesPkg: Add EFIAPI to generators hooks PierreGondois
2024-07-03 10:36   ` Sami Mujawar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CC089BAB-489D-4F28-AFF8-BEA291FD5144@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox